Skip to content

Commit

Permalink
[SCSI] mpt2sas: Fix leak on mpt2sas_base_attach() error path
Browse files Browse the repository at this point in the history
Commit 911ae94 ("[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>
  • Loading branch information
Roland Dreier authored and James Bottomley committed Dec 15, 2011
1 parent dab2f6b commit c24a171
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/mpt2sas/mpt2sas_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -4256,7 +4256,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] =
Expand Down

0 comments on commit c24a171

Please sign in to comment.