Check for NULLs.

Reviewed-by: Tomas Henzl <the...@redhat.com>
Reviewed-by: Manoj Kumar <ma...@linux.vnet.ibm.com>
Signed-off-by: Don Brace <don.br...@pmcs.com>
---
 drivers/scsi/hpsa.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 5a996273..b64913f 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -1138,6 +1138,9 @@ static int hpsa_find_target_lun(struct ctlr_info *h,
 static inline void hpsa_show_dev_msg(const char *level, struct ctlr_info *h,
        struct hpsa_scsi_dev_t *dev, char *description)
 {
+       if (h == NULL || h->pdev == NULL || h->scsi_host == NULL)
+               return;
+
        dev_printk(level, &h->pdev->dev,
                        "scsi %d:%d:%d:%d: %s %s %.8s %.16s RAID-%s 
SSDSmartPathCap%c En%c Exp=%d\n",
                        h->scsi_host->host_no, dev->bus, dev->target, dev->lun,

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to