summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2020-04-02 19:47:12 -0700
committerDan Williams <dan.j.williams@intel.com>2020-04-02 19:47:12 -0700
commit91bf79bcb61df7a89690f894f06b78b0e66fb43c (patch)
treea1c084cb92c484a95cdbee7eda36a5ccde902617 /drivers/nvdimm
parent04ff4863e1261187ef6152d2cf1f9a20e9b4cc04 (diff)
parent1f776799628139d0da47e710ad86eb58d987ff66 (diff)
downloadlinux-91bf79bcb61df7a89690f894f06b78b0e66fb43c.tar.bz2
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) */