From: Thomas Richter Date: Fri, 31 Mar 2023 09:42:20 +0000 (+0200) Subject: s390/cpum_cf: remove unnecessary copy_from_user call X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=26300860c2be489fa8c919e55fba28fa782cbb1e;p=linux.git s390/cpum_cf: remove unnecessary copy_from_user call Struct s390_ctrset_read userdata is filled by ioctl_read operation using put_user/copy_to_user. However, the ctrset->data value access is not performed anywhere during the ioctl_read operation. Remove unnecessary copy_from_user() call. No functional change. Signed-off-by: Thomas Richter Suggested-by: Sumanth Korikkar Acked-by: Sumanth Korikkar Signed-off-by: Vasily Gorbik --- diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c index 0b134c220948b..4c158faa3075c 100644 --- a/arch/s390/kernel/perf_cpum_cf.c +++ b/arch/s390/kernel/perf_cpum_cf.c @@ -1388,14 +1388,10 @@ static int cfset_all_read(unsigned long arg, struct cfset_request *req) static long cfset_ioctl_read(unsigned long arg, struct cfset_request *req) { - struct s390_ctrset_read read; int ret = -ENODATA; - if (req && req->ctrset) { - if (copy_from_user(&read, (char __user *)arg, sizeof(read))) - return -EFAULT; + if (req && req->ctrset) ret = cfset_all_read(arg, req); - } return ret; }