diff options
author | Dan Williams <dan.j.williams@intel.com> | 2020-04-02 19:47:12 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2020-04-02 19:47:12 -0700 |
commit | 91bf79bcb61df7a89690f894f06b78b0e66fb43c (patch) | |
tree | a1c084cb92c484a95cdbee7eda36a5ccde902617 /drivers/nvdimm | |
parent | 04ff4863e1261187ef6152d2cf1f9a20e9b4cc04 (diff) | |
parent | 1f776799628139d0da47e710ad86eb58d987ff66 (diff) | |
download | lwn-91bf79bcb61df7a89690f894f06b78b0e66fb43c.tar.gz lwn-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) */ |