All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Smart <James.Smart@Emulex.Com>
To: Linas Vepstas <linas@austin.ibm.com>
Cc: Bino.Sebastian@Emulex.Com, linuxppc-dev@ozlabs.org,
	linux-scsi@vger.kernel.org, James.Bottomley@SteelEye.com,
	rlary@us.ibm.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lpfc: avoid double-free during PCI error failure
Date: Sun, 11 Mar 2007 10:06:58 -0400	[thread overview]
Message-ID: <45F40D02.9060900@emulex.com> (raw)
In-Reply-To: <20070308221911.GC30703@austin.ibm.com>

ACK...  Looks good...

-- james s


Linas Vepstas wrote:
> Bino, James,
> Please review, sign-off and forward upstream.
> 
> --linas
> 
> 
> If a PCI error is detected that cannot be recovered from, there
> will be a double call of lpfc_pci_remove_one(), with the second call
> resulting in a null-pointer dereference. The first call occurs in 
> lpfc_io_error_detected(), and the second call during pci device 
> remove. This patch eliminates the first call; its un-needed.
> 
> Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
> 
> ----
>  drivers/scsi/lpfc/lpfc_init.c |    5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> Index: linux-2.6.20-git16/drivers/scsi/lpfc/lpfc_init.c
> ===================================================================
> --- linux-2.6.20-git16.orig/drivers/scsi/lpfc/lpfc_init.c	2007-03-08 15:57:40.000000000 -0600
> +++ linux-2.6.20-git16/drivers/scsi/lpfc/lpfc_init.c	2007-03-08 16:03:18.000000000 -0600
> @@ -1817,10 +1817,9 @@ static pci_ers_result_t lpfc_io_error_de
>  	struct lpfc_sli *psli = &phba->sli;
>  	struct lpfc_sli_ring  *pring;
>  
> -	if (state == pci_channel_io_perm_failure) {
> -		lpfc_pci_remove_one(pdev);
> +	if (state == pci_channel_io_perm_failure)
>  		return PCI_ERS_RESULT_DISCONNECT;
> -	}
> +
>  	pci_disable_device(pdev);
>  	/*
>  	 * There may be I/Os dropped by the firmware.
> 

WARNING: multiple messages have this Message-ID (diff)
From: James Smart <James.Smart@Emulex.Com>
To: Linas Vepstas <linas@austin.ibm.com>
Cc: James.Bottomley@SteelEye.com, linux-scsi@vger.kernel.org,
	Bino.Sebastian@Emulex.Com, linux-kernel@vger.kernel.org,
	linuxppc-dev@ozlabs.org, rlary@us.ibm.com
Subject: Re: [PATCH] lpfc: avoid double-free during PCI error failure
Date: Sun, 11 Mar 2007 10:06:58 -0400	[thread overview]
Message-ID: <45F40D02.9060900@emulex.com> (raw)
In-Reply-To: <20070308221911.GC30703@austin.ibm.com>

ACK...  Looks good...

-- james s


Linas Vepstas wrote:
> Bino, James,
> Please review, sign-off and forward upstream.
> 
> --linas
> 
> 
> If a PCI error is detected that cannot be recovered from, there
> will be a double call of lpfc_pci_remove_one(), with the second call
> resulting in a null-pointer dereference. The first call occurs in 
> lpfc_io_error_detected(), and the second call during pci device 
> remove. This patch eliminates the first call; its un-needed.
> 
> Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
> 
> ----
>  drivers/scsi/lpfc/lpfc_init.c |    5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> Index: linux-2.6.20-git16/drivers/scsi/lpfc/lpfc_init.c
> ===================================================================
> --- linux-2.6.20-git16.orig/drivers/scsi/lpfc/lpfc_init.c	2007-03-08 15:57:40.000000000 -0600
> +++ linux-2.6.20-git16/drivers/scsi/lpfc/lpfc_init.c	2007-03-08 16:03:18.000000000 -0600
> @@ -1817,10 +1817,9 @@ static pci_ers_result_t lpfc_io_error_de
>  	struct lpfc_sli *psli = &phba->sli;
>  	struct lpfc_sli_ring  *pring;
>  
> -	if (state == pci_channel_io_perm_failure) {
> -		lpfc_pci_remove_one(pdev);
> +	if (state == pci_channel_io_perm_failure)
>  		return PCI_ERS_RESULT_DISCONNECT;
> -	}
> +
>  	pci_disable_device(pdev);
>  	/*
>  	 * There may be I/Os dropped by the firmware.
> 

  reply	other threads:[~2007-03-11 14:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-08 22:19 [PATCH] lpfc: avoid double-free during PCI error failure Linas Vepstas
2007-03-08 22:19 ` Linas Vepstas
2007-03-11 14:06 ` James Smart [this message]
2007-03-11 14:06   ` James Smart

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=45F40D02.9060900@emulex.com \
    --to=james.smart@emulex.com \
    --cc=Bino.Sebastian@Emulex.Com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=linas@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=rlary@us.ibm.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.