Commit 1c6b0bc7 authored by Tian Tao's avatar Tian Tao Committed by Jens Axboe
Browse files

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: default avatarTian Tao <tiantao6@hisilicon.com>
Signed-off-by: default avatarMatias Bjørling <matias.bjorling@wdc.com>
Link: https://lore.kernel.org/r/20210413105257.159260-3-matias.bjorling@wdc.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 327e1d29
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;