From: Tian Tao Date: Tue, 13 Apr 2021 10:52:55 +0000 (+0000) Subject: lightnvm: return the correct return value X-Git-Tag: accepted/tizen/unified/20230118.172025~7357^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c6b0bc73fac9306462bd4794d00520690e97ef8;p=platform%2Fkernel%2Flinux-rpi.git lightnvm: return the correct return value 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 Signed-off-by: Matias Bjørling Link: https://lore.kernel.org/r/20210413105257.159260-3-matias.bjorling@wdc.com Signed-off-by: Jens Axboe --- diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index 28ddcaa..42774be 100644 --- 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;