projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
327e1d2
)
lightnvm: return the correct return value
author
Tian Tao
<tiantao6@hisilicon.com>
Tue, 13 Apr 2021 10:52:55 +0000
(10:52 +0000)
committer
Jens Axboe
<axboe@kernel.dk>
Tue, 13 Apr 2021 15:16:12 +0000
(09:16 -0600)
When memdup_user returns an error, memdup_user has two different return
values, use PTR_ERR to get the correct return value.
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Matias Bjørling <matias.bjorling@wdc.com>
Link:
https://lore.kernel.org/r/20210413105257.159260-3-matias.bjorling@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/core.c
patch
|
blob
|
history
diff --git
a/drivers/lightnvm/core.c
b/drivers/lightnvm/core.c
index 28ddcaa5358b141db53af65dc595b08ef80044e8..42774beeba94d724a4bf3240fdbc944f57851807 100644
(file)
--- a/
drivers/lightnvm/core.c
+++ b/
drivers/lightnvm/core.c
@@
-1257,7
+1257,7
@@
static long nvm_ioctl_info(struct file *file, void __user *arg)
info = memdup_user(arg, sizeof(struct nvm_ioctl_info));
if (IS_ERR(info))
- return
-EFAULT
;
+ return
PTR_ERR(info)
;
info->version[0] = NVM_VERSION_MAJOR;
info->version[1] = NVM_VERSION_MINOR;