Re: [PATCH 4.4 110/268] nvme-pci: Fix nvme queue cleanup if IRQ setup fails
From: Ben Hutchings
Date: Wed Jun 13 2018 - 12:37:48 EST
On Wed, 2018-06-13 at 10:30 -0600, Keith Busch wrote:
> On Wed, Jun 13, 2018 at 05:14:34PM +0100, Ben Hutchings wrote:
> > On Mon, 2018-05-28 at 12:01 +0200, Greg Kroah-Hartman wrote:
> > > Â result = adapter_alloc_sq(dev, qid, nvmeq);
> > > Â if (result < 0)
> > > @@ -1597,9 +1597,12 @@ static int nvme_create_queue(struct nvme
> > > Â return result;
> > > Â
> > > Â release_sq:
> > > + dev->online_queues--;
> >
> > This addition looks wrong.ÂÂdev->online_queues is incremented by
> > nvme_init_queue(), but this function only calls that at a point where
> > it is sure to succeed.ÂÂSo why would a failure path need to decrement
> > it?
>
> Thank you very much the catching that. This particular patch is indeed
> not correct without the following:
>
> Â 161b8be2bd6ab ("nvme-pci: initialize queue memory before interrupts")
Oh, now I see. Do you think that commit is suitable for stable
branches?
Ben.
--
Ben Hutchings, Software Developer  Codethink Ltd
https://www.codethink.co.uk/ Dale House, 35 Dale Street
Manchester, M1 2HF, United Kingdom