linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] nvme-pci: Fix NULL ptr deref in EEH code
       [not found] <20180320002242.10416-1-mikey@neuling.org>
@ 2018-03-20  7:22 ` Christoph Hellwig
  0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2018-03-20  7:22 UTC (permalink / raw)
  To: Michael Neuling
  Cc: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	linux-nvme, linux-kernel, linux-pci

On Tue, Mar 20, 2018 at 11:22:42AM +1100, Michael Neuling wrote:
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index b6f43b738f..404b346e3c 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -2626,6 +2626,9 @@ static pci_ers_result_t nvme_error_detected(struct pci_dev *pdev,
>  {
>  	struct nvme_dev *dev = pci_get_drvdata(pdev);
>  
> +	if (!dev)
> +		return PCI_ERS_RESULT_NEED_RESET;

This implies the method has been called before ->probe has been finished
or after ->remove has been called.  That would be fundamentally racy
and needs to be fixed in the PCI layer, not papered over in drivers.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-20  7:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20180320002242.10416-1-mikey@neuling.org>
2018-03-20  7:22 ` [PATCH] nvme-pci: Fix NULL ptr deref in EEH code Christoph Hellwig

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).