]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
libnvdimm: passthru functions clear to send
authorJerry Hoemann <jerry.hoemann@hpe.com>
Sat, 1 Jul 2017 03:41:22 +0000 (20:41 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sat, 1 Jul 2017 15:49:59 +0000 (08:49 -0700)
Have dsm functions called via the pass thru mechanism also
be checked against clear to send.

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/bus.c

index 63ce50d9c1c5869c06996ff83fbc8c0c8228a159..9730db48a01bd9be643770f57b1168e882498862 100644 (file)
@@ -910,6 +910,7 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm,
        static char in_env[ND_CMD_MAX_ENVELOPE];
        const struct nd_cmd_desc *desc = NULL;
        unsigned int cmd = _IOC_NR(ioctl_cmd);
+       unsigned int func = cmd;
        void __user *p = (void __user *) arg;
        struct device *dev = &nvdimm_bus->dev;
        struct nd_cmd_pkg pkg;
@@ -975,6 +976,7 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm,
        }
 
        if (cmd == ND_CMD_CALL) {
+               func = pkg.nd_command;
                dev_dbg(dev, "%s:%s, idx: %llu, in: %zu, out: %zu, len %zu\n",
                                __func__, dimm_name, pkg.nd_command,
                                in_len, out_len, buf_len);
@@ -1023,7 +1025,7 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm,
        }
 
        nvdimm_bus_lock(&nvdimm_bus->dev);
-       rc = nd_cmd_clear_to_send(nvdimm_bus, nvdimm, cmd, buf);
+       rc = nd_cmd_clear_to_send(nvdimm_bus, nvdimm, func, buf);
        if (rc)
                goto out_unlock;