]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - kernel/kcov.c
UBUNTU: link-to-tracker: update tracking bug
[mirror_ubuntu-bionic-kernel.git] / kernel / kcov.c
index 7594c033d98a39f3f51632a8f6f77b4440079ec4..2c16f1ab5e107562a8f9ade9735d97d0277931fd 100644 (file)
@@ -358,7 +358,8 @@ static int kcov_ioctl_locked(struct kcov *kcov, unsigned int cmd,
                 */
                if (kcov->mode != KCOV_MODE_INIT || !kcov->area)
                        return -EINVAL;
-               if (kcov->t != NULL)
+               t = current;
+               if (kcov->t != NULL || t->kcov != NULL)
                        return -EBUSY;
                if (arg == KCOV_TRACE_PC)
                        kcov->mode = KCOV_MODE_TRACE_PC;
@@ -370,7 +371,6 @@ static int kcov_ioctl_locked(struct kcov *kcov, unsigned int cmd,
 #endif
                else
                        return -EINVAL;
-               t = current;
                /* Cache in task struct for performance. */
                t->kcov_size = kcov->size;
                t->kcov_area = kcov->area;