From: Don Brace Date: Wed, 4 Nov 2015 21:50:25 +0000 (-0600) Subject: hpsa: check for null arguments to dev_printk X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9975ec9dbeb1775d29faaae50b31e2c19f740bf8;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git hpsa: check for null arguments to dev_printk Check for NULLs. Reviewed-by: Tomas Henzl Reviewed-by: Manoj Kumar Signed-off-by: Don Brace Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 5a99627368a3..b64913f9d880 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,