s390/cpum_cf: remove unnecessary copy_from_user call
authorThomas Richter <tmricht@linux.ibm.com>
Fri, 31 Mar 2023 09:42:20 +0000 (11:42 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Thu, 13 Apr 2023 15:36:27 +0000 (17:36 +0200)
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 <tmricht@linux.ibm.com>
Suggested-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/perf_cpum_cf.c

index 0b134c220948b9f3151abda150ce47ac6fd6aa35..4c158faa3075c637b3774851479dec5530ad8fb4 100644 (file)
@@ -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;
 }