Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: lustre: obdclass: return -EFAULT if copy_to_user() fails

We recently changed from using obd_ioctl_popdata() to calling
copy_to_user() directly. This if statement was supposed to be deleted
but it was over looked. "err" is zero at this point so it means we
return success.

Fixes: b03679f6a41a ("staging: lustre: uapi: remove obd_ioctl_popdata() wrapper")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dan Carpenter and committed by
Greg Kroah-Hartman
3ca121c2 9c8e28df

-1
-1
drivers/staging/lustre/lustre/obdclass/class_obd.c
··· 262 262 dev); 263 263 264 264 if (copy_to_user((void __user *)arg, data, sizeof(*data))) 265 - if (err) 266 265 err = -EFAULT; 267 266 goto out; 268 267 }