Commit af834d45 authored by Dan Williams's avatar Dan Williams

libnvdimm: smatch cleanups in __nd_ioctl

Drop use of access_ok() since we are already using copy_{to|from}_user()
which do their own access_ok().
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 31f02455
...@@ -535,8 +535,6 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, ...@@ -535,8 +535,6 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm,
__func__, dimm_name, cmd_name, i); __func__, dimm_name, cmd_name, i);
return -ENXIO; return -ENXIO;
} }
if (!access_ok(VERIFY_READ, p + in_len, in_size))
return -EFAULT;
if (in_len < sizeof(in_env)) if (in_len < sizeof(in_env))
copy = min_t(u32, sizeof(in_env) - in_len, in_size); copy = min_t(u32, sizeof(in_env) - in_len, in_size);
else else
...@@ -557,8 +555,6 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, ...@@ -557,8 +555,6 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm,
__func__, dimm_name, cmd_name, i); __func__, dimm_name, cmd_name, i);
return -EFAULT; return -EFAULT;
} }
if (!access_ok(VERIFY_WRITE, p + in_len + out_len, out_size))
return -EFAULT;
if (out_len < sizeof(out_env)) if (out_len < sizeof(out_env))
copy = min_t(u32, sizeof(out_env) - out_len, out_size); copy = min_t(u32, sizeof(out_env) - out_len, out_size);
else else
...@@ -570,9 +566,6 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, ...@@ -570,9 +566,6 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm,
} }
buf_len = out_len + in_len; buf_len = out_len + in_len;
if (!access_ok(VERIFY_WRITE, p, sizeof(buf_len)))
return -EFAULT;
if (buf_len > ND_IOCTL_MAX_BUFLEN) { if (buf_len > ND_IOCTL_MAX_BUFLEN) {
dev_dbg(dev, "%s:%s cmd: %s buf_len: %zu > %d\n", __func__, dev_dbg(dev, "%s:%s cmd: %s buf_len: %zu > %d\n", __func__,
dimm_name, cmd_name, buf_len, dimm_name, cmd_name, buf_len,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment