summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2020-04-03 04:47:12 +0200
committerDan Williams <dan.j.williams@intel.com>2020-04-03 04:47:12 +0200
commit91bf79bcb61df7a89690f894f06b78b0e66fb43c (patch)
treea1c084cb92c484a95cdbee7eda36a5ccde902617 /drivers/nvdimm
parentlibnvdimm/region: Fix build error (diff)
parenttools/test/nvdimm: Fix out of tree build (diff)
downloadlinux-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.c6
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) */