]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - kernel/events/core.c
perf: Return proper values for user stack errors
[mirror_ubuntu-bionic-kernel.git] / kernel / events / core.c
index ed7438746bc18d30979467a0eb3912e5b71d5e70..30bb5ea0dcc25b391ad52684a972773f19939399 100644 (file)
@@ -9703,9 +9703,9 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr,
                 * __u16 sample size limit.
                 */
                if (attr->sample_stack_user >= USHRT_MAX)
-                       ret = -EINVAL;
+                       return -EINVAL;
                else if (!IS_ALIGNED(attr->sample_stack_user, sizeof(u64)))
-                       ret = -EINVAL;
+                       return -EINVAL;
        }
 
        if (attr->sample_type & PERF_SAMPLE_REGS_INTR)