All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicholas Krause <xerofoify@gmail.com>
To: nagalakshmi.nandigama@avagotech.com
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
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	[thread overview]
Message-ID: <1450554187-14812-1-git-send-email-xerofoify@gmail.com> (raw)

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 <xerofoify@gmail.com>
---
 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,
-- 
2.5.0

WARNING: multiple messages have this Message-ID (diff)
From: xerofoify@gmail.com (Nicholas Krause)
To: linux-arm-kernel@lists.infradead.org
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	[thread overview]
Message-ID: <1450554187-14812-1-git-send-email-xerofoify@gmail.com> (raw)

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 <xerofoify@gmail.com>
---
 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,
-- 
2.5.0

             reply	other threads:[~2015-12-19 19:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-19 19:43 Nicholas Krause [this message]
2015-12-19 19:43 ` [PATCH] mpt3sas:Fix missing error checks for calls to _transport_phy_reset in mpt3sas_transport.c Nicholas Krause
  -- strict thread matches above, loose matches on Subject: below --
2015-12-19 19:42 Nicholas Krause
2015-12-19 19:42 ` Nicholas Krause

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1450554187-14812-1-git-send-email-xerofoify@gmail.com \
    --to=xerofoify@gmail.com \
    --cc=JBottomley@odin.com \
    --cc=MPT-FusionLinux.pdl@avagotech.com \
    --cc=abhijit.mahajan@avagotech.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=jonmason@broadcom.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=nagalakshmi.nandigama@avagotech.com \
    --cc=praveen.krishnamoorthy@avagotech.com \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    --cc=sreekanth.reddy@avagotech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.