]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
[SCSI] mpt2sas: Fix leak on mpt2sas_base_attach() error path
authorRoland Dreier <roland@purestorage.com>
Thu, 1 Dec 2011 01:14:22 +0000 (17:14 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 16 Dec 2011 16:49:34 +0000 (11:49 -0500)
Commit 911ae9434f83 ("[SCSI] mpt2sas: Added NUNA IO support in driver
which uses multi-reply queue support of the HBA") added new
allocations to the beginning of mpt2sas_base_attach(), which means
directly returning an error on failure of mpt2sas_base_map_resources()
will leak those allocations.

Fix this by doing "goto out_free_resources" in this place too, as the
rest of the function does.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Acked-by: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/mpt2sas/mpt2sas_base.c

index 088c9e25c464b951ac589571c5d539eb6bc5b117..9f992b08cd97c85395fa869812fe9fa381c43f04 100644 (file)
@@ -4271,7 +4271,7 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc)
 
        r = mpt2sas_base_map_resources(ioc);
        if (r)
-               return r;
+               goto out_free_resources;
 
        if (ioc->is_warpdrive) {
                ioc->reply_post_host_index[0] =