From patchwork Sat Dec 19 19:43:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick X-Patchwork-Id: 7890751 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BEE8A9F1AF for ; Sat, 19 Dec 2015 19:44:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB0A12047B for ; Sat, 19 Dec 2015 19:44:49 +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 1D78A20430 for ; Sat, 19 Dec 2015 19:44:49 +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 1aANPk-0003R7-He; Sat, 19 Dec 2015 19:43:36 +0000 Received: from mail-qg0-x242.google.com ([2607:f8b0:400d:c04::242]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aANPh-0003Lj-9v for linux-arm-kernel@lists.infradead.org; Sat, 19 Dec 2015 19:43:34 +0000 Received: by mail-qg0-x242.google.com with SMTP id c96so10824615qgd.0 for ; Sat, 19 Dec 2015 11:43: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=Wqh9wdQa3LMaprEno1MNv1dLM6/fPElJRsUb79EAD3GfDdfl+TT4K1A35M86D/vXyR IcuQXwoMQz/qTKq/dpRkNunm5NtjBpCO7wyMV1F30guOZsZ6SnLvlIKC8DrOBSRU6OSP x9CcXrjNCDOk56M0nvcpg9RPyCihkIcX+iD8ixo9YT4C+lVVbMNtJYMCWGhm6RSbikfw udIUjeGgKx6d0CjJSEvEMwaeOJQmc9dbcRt+wxc1JCSMvSYwd2v6zQjBuvSN+bKcDGfg dDozcNMUccUf5WQxA6Z9tHfBQWqDh7qdwDnNb89t6WpNo+ZZj7ve3d/KGk8iFUIZqXxF RyIA== X-Received: by 10.140.92.215 with SMTP id b81mr1371086qge.44.1450554191278; Sat, 19 Dec 2015 11:43:11 -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 j36sm9393341qgd.46.2015.12.19.11.43.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 19 Dec 2015 11:43:10 -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:43:07 -0500 Message-Id: <1450554187-14812-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_114333_469176_624981C3 X-CRM114-Status: GOOD ( 10.05 ) 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, sbranden@broadcom.com, martin.petersen@oracle.com, jonmason@broadcom.com, rjui@broadcom.com, JBottomley@odin.com, linux-kernel@vger.kernel.org, sreekanth.reddy@avagotech.com, praveen.krishnamoorthy@avagotech.com, bcm-kernel-feedback-list@broadcom.com, linux-scsi@vger.kernel.org, MPT-FusionLinux.pdl@avagotech.com, 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,