diff options
author | Dan Williams <dan.j.williams@intel.com> | 2020-04-03 04:47:12 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2020-04-03 04:47:12 +0200 |
commit | 91bf79bcb61df7a89690f894f06b78b0e66fb43c (patch) | |
tree | a1c084cb92c484a95cdbee7eda36a5ccde902617 /drivers/nvdimm | |
parent | libnvdimm/region: Fix build error (diff) | |
parent | tools/test/nvdimm: Fix out of tree build (diff) | |
download | linux-91bf79bcb61df7a89690f894f06b78b0e66fb43c.tar.xz linux-91bf79bcb61df7a89690f894f06b78b0e66fb43c.zip |
Merge branch 'for-5.6/libnvdimm-fixes' into libnvdimm-for-next
Pick up some miscellaneous minor fixes, that missed v5.6-final,
including a some smatch reports in the ioctl path and some unit test
compilation fixups.
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r-- | drivers/nvdimm/bus.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index a8b515968569..09087c38fabd 100644 --- a/drivers/nvdimm/bus.c +++ b/drivers/nvdimm/bus.c @@ -1042,8 +1042,10 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, return -EFAULT; } - if (!desc || (desc->out_num + desc->in_num == 0) || - !test_bit(cmd, &cmd_mask)) + if (!desc || + (desc->out_num + desc->in_num == 0) || + cmd > ND_CMD_CALL || + !test_bit(cmd, &cmd_mask)) return -ENOTTY; /* fail write commands (when read-only) */ |