summaryrefslogtreecommitdiff
path: root/drivers/scsi/hpsa.c
diff options
context:
space:
mode:
authorJoe Handzik <joseph.t.handzik@hp.com>2014-05-16 00:44:42 +0400
committerChristoph Hellwig <hch@lst.de>2014-05-19 21:12:28 +0400
commit6e8e8088aa9d2f0108dda6943aea8930be6f8f22 (patch)
tree31ba65c3b6f78de991f5a9018d0721c63367ace0 /drivers/scsi/hpsa.c
parent3b7a45e5ba85dc79c7714edd9eee9aaed730cd6b (diff)
downloadlinux-6e8e8088aa9d2f0108dda6943aea8930be6f8f22.tar.xz
hpsa: fix memory leak in hpsa_hba_mode_enabled
And while we're at it fix a magic number Signed-off-by: Joe Handzik <joseph.t.handzik@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index ef669054aba5..7eb3b9a78537 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -2977,6 +2977,7 @@ u8 *figure_lunaddrbytes(struct ctlr_info *h, int raid_ctlr_position, int i,
static int hpsa_hba_mode_enabled(struct ctlr_info *h)
{
int rc;
+ int hba_mode_enabled;
struct bmic_controller_parameters *ctlr_params;
ctlr_params = kzalloc(sizeof(struct bmic_controller_parameters),
GFP_KERNEL);
@@ -2989,7 +2990,11 @@ static int hpsa_hba_mode_enabled(struct ctlr_info *h)
kfree(ctlr_params);
return 0;
}
- return ctlr_params->nvram_flags & (1 << 3) ? 1 : 0;
+
+ hba_mode_enabled =
+ ((ctlr_params->nvram_flags & HBA_MODE_ENABLED_FLAG) != 0);
+ kfree(ctlr_params);
+ return hba_mode_enabled;
}
static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno)