From: Joe Handzik Date: Thu, 15 May 2014 20:44:47 +0000 (-0500) Subject: hpsa: do not ignore failure of sense controller parameters command X-Git-Tag: firefly_0821_release~176^2~3742^2~83 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=96444fbbbf3b55a9cd1e337cc5c8c7d04bb364b7;p=firefly-linux-kernel-4.4.55.git hpsa: do not ignore failure of sense controller parameters command Signed-off-by: Joe Handzik Signed-off-by: Stephen M. Cameron Signed-off-by: Christoph Hellwig --- diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 7eb3b9a78537..13d4cc5685b7 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -2983,12 +2983,12 @@ static int hpsa_hba_mode_enabled(struct ctlr_info *h) GFP_KERNEL); if (!ctlr_params) - return 0; + return -ENOMEM; rc = hpsa_bmic_ctrl_mode_sense(h, RAID_CTLR_LUNID, 0, ctlr_params, sizeof(struct bmic_controller_parameters)); - if (rc != 0) { + if (rc) { kfree(ctlr_params); - return 0; + return rc; } hba_mode_enabled = @@ -3035,6 +3035,8 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno) memset(lunzerobits, 0, sizeof(lunzerobits)); rescan_hba_mode = hpsa_hba_mode_enabled(h); + if (rescan_hba_mode < 0) + goto out; if (!h->hba_mode_enabled && rescan_hba_mode) dev_warn(&h->pdev->dev, "HBA mode enabled\n");