Skip to contentSkip to conversation

mpt3sas: remove redundant copy_from_user in _ctl_getiocinfo

PATCH Applied Meng Xu 3 participants 3 messages Sep 20, 2017 – Sep 25, 2017

Subsystems (2)
lore
Share & tools
lore

Meng Xu

author
#0 lore raw

PATCH 1/1 mpt3sas: remove redundant copy_from_user in _ctl_getiocinfo

Since right after the user copy, we are going to memset(&karg, 0, sizeof(karg)), the copy_from_user is redundant

---
 drivers/scsi/mpt3sas/mpt3sas_ctl.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/scsi/mpt3sas/mpt3sas_ctl.c +0 -6
index bdffb69..d448fed 100644
@@ -1065,12 +1065,6 @@ _ctl_getiocinfo(struct MPT3SAS_ADAPTER *ioc, void __user *arg)
 {
 	struct mpt3_ioctl_iocinfo karg;
 
-	if (copy_from_user(&karg, arg, sizeof(karg))) {
-		pr_err("failure at %s:%d/%s()!\n",
-		    __FILE__, __LINE__, __func__);
-		return -EFAULT;
-	}
-
 	dctlprintk(ioc, pr_info(MPT3SAS_FMT "%s: enter\n", ioc->name,
 	    __func__));
 
Signature · 1 line
2.7.4
#2 lore raw
In reply to Meng Xu

Meng,

Quoted 2 lines

Since right after the user copy, we are going to memset(&karg, 0, sizeof(karg)), the copy_from_user is redundant

Applied to 4.15/scsi-queue. Thank you!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering