summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-05-13 12:37:03 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2020-05-14 20:24:01 -0400
commit25c21d20bcfdb97ba869007b284a5dbf5328ffe2 (patch)
treec53ed19603efc5a70abbd162e45ffff25a238d0a /drivers/scsi/aacraid
parent55ce24b3bfd75f76696a00f2666caaf806eebea2 (diff)
downloadlinux-25c21d20bcfdb97ba869007b284a5dbf5328ffe2.tar.gz
linux-25c21d20bcfdb97ba869007b284a5dbf5328ffe2.tar.bz2
linux-25c21d20bcfdb97ba869007b284a5dbf5328ffe2.zip
scsi: aacraid: Fix an oops in error handling
If the memdup_user() function fails then it results in an Oops in the error handling code when we try to kfree() and error pointer. Link: https://lore.kernel.org/r/20200513093703.GB347693@mwanda Fixes: 8d925b1f00e6 ("scsi: aacraid: Use memdup_user() as a cleanup") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/aacraid')
-rw-r--r--drivers/scsi/aacraid/commctrl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
index 102658bdc15a..34e65dea992e 100644
--- a/drivers/scsi/aacraid/commctrl.c
+++ b/drivers/scsi/aacraid/commctrl.c
@@ -516,6 +516,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
user_srbcmd = memdup_user(user_srb, fibsize);
if (IS_ERR(user_srbcmd)) {
rcode = PTR_ERR(user_srbcmd);
+ user_srbcmd = NULL;
goto cleanup;
}