stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] scsi: scsi_transport_fc: Fix a bug in the error handling function
@ 2016-01-08  0:40 K. Y. Srinivasan
  2016-01-07 23:48 ` James Bottomley
  0 siblings, 1 reply; 7+ messages in thread
From: K. Y. Srinivasan @ 2016-01-08  0:40 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, ohering, jbottomley, hch, linux-scsi,
	apw, vkuznets, jasowang, martin.petersen, hare
  Cc: K. Y. Srinivasan, stable

The macro startget_to_rport() can return NULL; handle that case
properly.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: <stable@vger.kernel.org>
---
 drivers/scsi/scsi_transport_fc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 24eaaf6..42a908f 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -2081,7 +2081,7 @@ fc_timed_out(struct scsi_cmnd *scmd)
 {
 	struct fc_rport *rport = starget_to_rport(scsi_target(scmd->device));
 
-	if (rport->port_state == FC_PORTSTATE_BLOCKED)
+	if ((rport == NULL) || (rport->port_state == FC_PORTSTATE_BLOCKED))
 		return BLK_EH_RESET_TIMER;
 
 	return BLK_EH_NOT_HANDLED;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-01-08 21:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-08  0:40 [PATCH 1/1] scsi: scsi_transport_fc: Fix a bug in the error handling function K. Y. Srinivasan
2016-01-07 23:48 ` James Bottomley
2016-01-08 18:58   ` KY Srinivasan
2016-01-08 19:20     ` James Bottomley
2016-01-08 20:12       ` KY Srinivasan
2016-01-08 20:26         ` James Bottomley
2016-01-08 21:35           ` KY Srinivasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).