From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bedivere.hansenpartnership.com ([66.63.167.143]:38482 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753651AbcAGXse (ORCPT ); Thu, 7 Jan 2016 18:48:34 -0500 Message-ID: <1452210511.15259.38.camel@HansenPartnership.com> Subject: Re: [PATCH 1/1] scsi: scsi_transport_fc: Fix a bug in the error handling function From: James Bottomley To: "K. Y. Srinivasan" , gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, ohering@suse.com, jbottomley@parallels.com, hch@infradead.org, linux-scsi@vger.kernel.org, apw@canonical.com, vkuznets@redhat.com, jasowang@redhat.com, martin.petersen@oracle.com, hare@suse.de Cc: stable@vger.kernel.org Date: Thu, 07 Jan 2016 15:48:31 -0800 In-Reply-To: <1452213645-18889-1-git-send-email-kys@microsoft.com> References: <1452213645-18889-1-git-send-email-kys@microsoft.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On Thu, 2016-01-07 at 16:40 -0800, K. Y. Srinivasan wrote: > The macro startget_to_rport() can return NULL; handle that case > properly. OK, can we unwind why you think you could possibly need this? It would mean that fc_timed_out was called for a non-FC device, which was thought to be an impossibility when the fc transport class was designed. James > Signed-off-by: K. Y. Srinivasan > Cc: > --- > 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;