Commit a139834e authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

staging: lustre: selftest: freeing an error pointer

We should just return directly if memdup_user() fails. The current code
tries to free "param" which is an error pointer so it will Oops.

Fixes: 2baddf26 ("staging: lustre: use memdup_user to allocate memory and copy from user")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 52edc44f
...@@ -650,10 +650,8 @@ static int lst_test_add_ioctl(struct lstio_test_args *args) ...@@ -650,10 +650,8 @@ static int lst_test_add_ioctl(struct lstio_test_args *args)
if (args->lstio_tes_param) { if (args->lstio_tes_param) {
param = memdup_user(args->lstio_tes_param, param = memdup_user(args->lstio_tes_param,
args->lstio_tes_param_len); args->lstio_tes_param_len);
if (IS_ERR(param)) { if (IS_ERR(param))
rc = PTR_ERR(param); return PTR_ERR(param);
goto out;
}
} }
rc = -EFAULT; rc = -EFAULT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment