[PATCH] nvme: fix admin request_queue lifetime

Keith Busch kbusch at kernel.org
Wed Nov 5 12:31:10 PST 2025


On Wed, Nov 05, 2025 at 12:21:14PM -0800, Casey Chen wrote:
> On Tue, Nov 4, 2025 at 3:00 PM Keith Busch <kbusch at meta.com> wrote:
> > @@ -5045,6 +5044,7 @@ static void nvme_free_ctrl(struct device *dev)
> >                 container_of(dev, struct nvme_ctrl, ctrl_device);
> >         struct nvme_subsystem *subsys = ctrl->subsys;
> >
> > +       blk_put_queue(ctrl->admin_q);
> 
> Wait. Do we need to check ctrl->admin_q non-NULL before putting it ?
> If nvme_alloc_admin_tag_set() fails, blk_put_queue() would put NULL
> and panic kernel.

Oh, like if we call nvme_uninit_ctrl() prior to allocating the tagset?
Yes, I think you're right, unlikely as that is to occur. Thanks, I'll
fold in your suggestion.



More information about the Linux-nvme mailing list