]> www.infradead.org Git - linux-platform-drivers-x86.git/commitdiff
nvme: pass a user pointer to nvme_nvm_ioctl
authorChristoph Hellwig <hch@lst.de>
Fri, 14 Aug 2020 08:33:14 +0000 (10:33 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 15 Apr 2021 06:12:54 +0000 (08:12 +0200)
Pass the proper user pointer instead of the not all that useful integer
representation.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Javier González <javier.gonz@samsung.com>
drivers/nvme/host/core.c
drivers/nvme/host/lightnvm.c
drivers/nvme/host/nvme.h

index d9a33a4f7cc6e11dae960690357df52a32ec4f67..2e932935e05e812da6066431ced97557a9701ce0 100644 (file)
@@ -1819,7 +1819,7 @@ static int nvme_ioctl(struct block_device *bdev, fmode_t mode,
                break;
        default:
                if (ns->ndev)
-                       ret = nvme_nvm_ioctl(ns, cmd, arg);
+                       ret = nvme_nvm_ioctl(ns, cmd, argp);
                else
                        ret = -ENOTTY;
        }
index e3240d1890932574f47d30cc3a20a59d1bb10d24..848e55bbb64fff6ee85b1c09b5f96c18fa46923a 100644 (file)
@@ -930,15 +930,15 @@ static int nvme_nvm_user_vcmd(struct nvme_ns *ns, int admin,
        return ret;
 }
 
-int nvme_nvm_ioctl(struct nvme_ns *ns, unsigned int cmd, unsigned long arg)
+int nvme_nvm_ioctl(struct nvme_ns *ns, unsigned int cmd, void __user *argp)
 {
        switch (cmd) {
        case NVME_NVM_IOCTL_ADMIN_VIO:
-               return nvme_nvm_user_vcmd(ns, 1, (void __user *)arg);
+               return nvme_nvm_user_vcmd(ns, 1, argp);
        case NVME_NVM_IOCTL_IO_VIO:
-               return nvme_nvm_user_vcmd(ns, 0, (void __user *)arg);
+               return nvme_nvm_user_vcmd(ns, 0, argp);
        case NVME_NVM_IOCTL_SUBMIT_VIO:
-               return nvme_nvm_submit_vio(ns, (void __user *)arg);
+               return nvme_nvm_submit_vio(ns, argp);
        default:
                return -ENOTTY;
        }
index 2ef0a355fbb4ae18a9ee0e3b67e044cfa49478d3..70018ae2cb18769256c23729101b5e7d9a384e0f 100644 (file)
@@ -799,7 +799,7 @@ static inline int nvme_update_zone_info(struct nvme_ns *ns, unsigned lbaf)
 int nvme_nvm_register(struct nvme_ns *ns, char *disk_name, int node);
 void nvme_nvm_unregister(struct nvme_ns *ns);
 extern const struct attribute_group nvme_nvm_attr_group;
-int nvme_nvm_ioctl(struct nvme_ns *ns, unsigned int cmd, unsigned long arg);
+int nvme_nvm_ioctl(struct nvme_ns *ns, unsigned int cmd, void __user *argp);
 #else
 static inline int nvme_nvm_register(struct nvme_ns *ns, char *disk_name,
                                    int node)
@@ -809,7 +809,7 @@ static inline int nvme_nvm_register(struct nvme_ns *ns, char *disk_name,
 
 static inline void nvme_nvm_unregister(struct nvme_ns *ns) {};
 static inline int nvme_nvm_ioctl(struct nvme_ns *ns, unsigned int cmd,
-                                                       unsigned long arg)
+               void __user *argp)
 {
        return -ENOTTY;
 }