summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-02-22 12:15:34 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-02-22 15:07:44 +0100
commita139834ed6ce795691106e35d287226c95c75866 (patch)
tree49525e754f10e88ceaa4606a80f24260a109755d /drivers
parent52edc44ffbd05a3f6f6a8db2b07e2d3c6cb81db3 (diff)
downloadlwn-a139834ed6ce795691106e35d287226c95c75866.tar.gz
lwn-a139834ed6ce795691106e35d287226c95c75866.zip
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: 2baddf262e98 ("staging: lustre: use memdup_user to allocate memory and copy from user") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/lustre/lnet/selftest/conctl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c
index 3c919a536e91..51497cf9a832 100644
--- a/drivers/staging/lustre/lnet/selftest/conctl.c
+++ b/drivers/staging/lustre/lnet/selftest/conctl.c
@@ -650,10 +650,8 @@ static int lst_test_add_ioctl(struct lstio_test_args *args)
if (args->lstio_tes_param) {
param = memdup_user(args->lstio_tes_param,
args->lstio_tes_param_len);
- if (IS_ERR(param)) {
- rc = PTR_ERR(param);
- goto out;
- }
+ if (IS_ERR(param))
+ return PTR_ERR(param);
}
rc = -EFAULT;