From patchwork Wed Nov 4 21:50:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 7554001 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D361CBEEA4 for ; Wed, 4 Nov 2015 21:54:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0DE9220604 for ; Wed, 4 Nov 2015 21:54:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28CBE205E7 for ; Wed, 4 Nov 2015 21:54:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965732AbbKDVyS (ORCPT ); Wed, 4 Nov 2015 16:54:18 -0500 Received: from bby1mta03.pmc-sierra.com ([216.241.235.118]:53336 "EHLO bby1mta03.pmc-sierra.bc.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965397AbbKDVyS (ORCPT ); Wed, 4 Nov 2015 16:54:18 -0500 Received: from bby1mta03.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id C667A10708E0; Wed, 4 Nov 2015 13:54:17 -0800 (PST) Received: from bby1uinfra02-temp.pmc-sierra.bc.ca (bby1uinfra02-temp.pmc-sierra.bc.ca [216.241.226.204]) by bby1mta03.pmc-sierra.bc.ca (Postfix) with ESMTP id A53FB10708CC; Wed, 4 Nov 2015 13:54:17 -0800 (PST) Received: from [127.0.1.1] (kirk.hou.lab.pmc-sierra.bc.ca [10.238.32.34]) by bby1uinfra02-temp.pmc-sierra.bc.ca (Postfix) with ESMTP id 0B00AE06DF; Wed, 4 Nov 2015 13:54:16 -0800 (PST) Subject: [PATCH v2 05/27] hpsa: check for null arguments to dev_printk From: Don Brace To: scott.teel@pmcs.com, Kevin.Barnett@pmcs.com, scott.benesh@pmcs.com, james.bottomley@parallels.com, hch@infradead.org, Justin.Lindley@pmcs.com, elliott@hpe.com Cc: linux-scsi@vger.kernel.org Date: Wed, 04 Nov 2015 15:50:25 -0600 Message-ID: <20151104215025.15472.12183.stgit@brunhilda> In-Reply-To: <20151104214910.15472.23179.stgit@brunhilda> References: <20151104214910.15472.23179.stgit@brunhilda> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pmcs.com; h=subject:from:to:cc:date:message-id:in-reply-to:references:mime-version:content-type:content-transfer-encoding; s=default; bh=xLoy8u2sdWBOvss7WJLo1llUs3m+vshQsX5er/p61zY=; b=oNgSdyxmpDFSW9SeG5kLprGkPqZP4qx0m87G1i22XHOW42cxQFby2YcvY2tYGBh1HcUf9W/3MJCtwaBPVX5WZHLpGs7ne2wwcMHuaEGRvKYgL/HxrS+d2vsVtq8iFmqFRCER2KRX5epiRrAYXnu1pVa4iifG8atHdAjTMRhxyD8= Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Check for NULLs. Reviewed-by: Tomas Henzl Reviewed-by: Manoj Kumar Signed-off-by: Don Brace Reviewed-by: Hannes Reinecke --- drivers/scsi/hpsa.c | 3 +++ 1 file changed, 3 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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,