From patchwork Sat Dec 19 19:42:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick X-Patchwork-Id: 7890741 Return-Path: X-Original-To: patchwork-linux-arm@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 BAE33BEEE5 for ; Sat, 19 Dec 2015 19:44:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E8C722041D for ; Sat, 19 Dec 2015 19:44:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 00726203ED for ; Sat, 19 Dec 2015 19:44:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aANOk-0003GW-Da; Sat, 19 Dec 2015 19:42:34 +0000 Received: from mail-qg0-x243.google.com ([2607:f8b0:400d:c04::243]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aANOh-0003EI-Ix for linux-arm-kernel@lists.infradead.org; Sat, 19 Dec 2015 19:42:32 +0000 Received: by mail-qg0-x243.google.com with SMTP id c96so10823279qgd.0 for ; Sat, 19 Dec 2015 11:42:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=+GrVM1txwt+1+cGA5fqwlRIBfEsvQd+D/UvGl6AfMXI=; b=Extwu90z33RnAXJGf/d1zA4w8WazE5X+udfZkepvK22AwiQdSWJE+ipZYFugUVoqnc X2cl1DH6K9sfMwHqvusOda8v9DJif412isgdHCVQ0j371gWlUON9wYCsXBUkVvFSDsbN IFB90vndH73QLZL+tThmqJ+votkYa9jq8IqMxrgTs9L05Fg1nVJHR+UN9KkJyPSTCar9 cKHG9D1Fh20Qf5YIUKDpNLLW0Kcm+PmnUpczH+XRslaykS2mgdB5fyf1TGPEPVz4gywF Dn/u6WjMEab46TbJu87j9LQl6NKud9z8tVZ4yyIy3ssiNSVjTjHSKe3B5QDl6/szVyB1 QBHQ== X-Received: by 10.140.105.36 with SMTP id b33mr14486434qgf.94.1450554130019; Sat, 19 Dec 2015 11:42:10 -0800 (PST) Received: from nick-System-Product-Name.hitronhub.home (CPEbc4dfb2691f3-CMbc4dfb2691f0.cpe.net.cable.rogers.com. [99.231.110.121]) by smtp.googlemail.com with ESMTPSA id d6sm9458378qkb.13.2015.12.19.11.42.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 19 Dec 2015 11:42:09 -0800 (PST) From: Nicholas Krause To: nagalakshmi.nandigama@avagotech.com Subject: [PATCH] mpt3sas:Fix missing error checks for calls to _transport_phy_reset in mpt3sas_transport.c Date: Sat, 19 Dec 2015 14:42:05 -0500 Message-Id: <1450554125-14756-1-git-send-email-xerofoify@gmail.com> X-Mailer: git-send-email 2.5.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151219_114231_739940_CF8EE6F5 X-CRM114-Status: GOOD ( 10.15 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: abhijit.mahajan@avagotech.com, linux-kernel@vger.kernel.org, sbranden@broadcom.com, martin.petersen@oracle.com, jonmason@broadcom.com, rjui@broadcom.com, JBottomley@odin.com, MPT-FusionLinux.pdl@avagotech.co, sreekanth.reddy@avagotech.com, praveen.krishnamoorthy@avagotech.com, bcm-kernel-feedback-list@broadcom.com, linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, 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 This adds the missing error checks and paths for functions that call _transport_phy_reset and do not correctly check that the call to this particular function has succeeded by returning zero in the file, mpt3sas_transport.c. Signed-off-by: Nicholas Krause --- drivers/scsi/mpt3sas/mpt3sas_transport.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c index ca36d7e..bff5a11 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_transport.c +++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c @@ -1766,7 +1766,7 @@ _transport_phy_enable(struct sas_phy *phy, int enable) /* link reset */ if (enable) - _transport_phy_reset(phy, 0); + rc = _transport_phy_reset(phy, 0); out: kfree(sas_iounit_pg1); @@ -1870,7 +1870,9 @@ _transport_phy_speed(struct sas_phy *phy, struct sas_phy_linkrates *rates) } /* link reset */ - _transport_phy_reset(phy, 0); + rc = _transport_phy_reset(phy, 0); + if (rc) + goto out; /* read phy page 0, then update the rates in the sas transport phy */ if (!mpt3sas_config_get_phy_pg0(ioc, &mpi_reply, &phy_pg0,