lpfc debugfs: get rid of pointless access_ok()
copy_from_user() needs no protection - it does the checks itself Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
5a5011936e
commit
20dcf8e244
@ -1942,10 +1942,6 @@ lpfc_debugfs_nvmestat_write(struct file *file, const char __user *buf,
|
||||
if (nbytes > 64)
|
||||
nbytes = 64;
|
||||
|
||||
/* Protect copy from user */
|
||||
if (!access_ok(VERIFY_READ, buf, nbytes))
|
||||
return -EFAULT;
|
||||
|
||||
memset(mybuf, 0, sizeof(mybuf));
|
||||
|
||||
if (copy_from_user(mybuf, buf, nbytes))
|
||||
@ -2026,10 +2022,6 @@ lpfc_debugfs_nvmektime_write(struct file *file, const char __user *buf,
|
||||
if (nbytes > 64)
|
||||
nbytes = 64;
|
||||
|
||||
/* Protect copy from user */
|
||||
if (!access_ok(VERIFY_READ, buf, nbytes))
|
||||
return -EFAULT;
|
||||
|
||||
memset(mybuf, 0, sizeof(mybuf));
|
||||
|
||||
if (copy_from_user(mybuf, buf, nbytes))
|
||||
@ -2158,10 +2150,6 @@ lpfc_debugfs_nvmeio_trc_write(struct file *file, const char __user *buf,
|
||||
if (nbytes > 64)
|
||||
nbytes = 64;
|
||||
|
||||
/* Protect copy from user */
|
||||
if (!access_ok(VERIFY_READ, buf, nbytes))
|
||||
return -EFAULT;
|
||||
|
||||
memset(mybuf, 0, sizeof(mybuf));
|
||||
|
||||
if (copy_from_user(mybuf, buf, nbytes))
|
||||
@ -2269,10 +2257,6 @@ lpfc_debugfs_cpucheck_write(struct file *file, const char __user *buf,
|
||||
if (nbytes > 64)
|
||||
nbytes = 64;
|
||||
|
||||
/* Protect copy from user */
|
||||
if (!access_ok(VERIFY_READ, buf, nbytes))
|
||||
return -EFAULT;
|
||||
|
||||
memset(mybuf, 0, sizeof(mybuf));
|
||||
|
||||
if (copy_from_user(mybuf, buf, nbytes))
|
||||
@ -2343,10 +2327,6 @@ static int lpfc_idiag_cmd_get(const char __user *buf, size_t nbytes,
|
||||
int i;
|
||||
size_t bsize;
|
||||
|
||||
/* Protect copy from user */
|
||||
if (!access_ok(VERIFY_READ, buf, nbytes))
|
||||
return -EFAULT;
|
||||
|
||||
memset(mybuf, 0, sizeof(mybuf));
|
||||
memset(idiag_cmd, 0, sizeof(*idiag_cmd));
|
||||
bsize = min(nbytes, (sizeof(mybuf)-1));
|
||||
|
Loading…
Reference in New Issue
Block a user