Re: [PATCHv2 1/6] nvme-pci: Free tagset if no IO queues

Keith Busch
2019-09-20T17:53:58Z

On Fri, Sep 20, 2019 at 10:49:11AM -0700, Sagi Grimberg wrote:
>
> > +static void nvme_free_tagset(struct nvme_dev *dev)
> > +{
> > + if (dev->tagset.tags)
> > + blk_mq_free_tag_set(&dev->tagset);
> > + dev->ctrl.tagset = NULL;
> > +}
> > +
>
> testing dev->tagset.tags and nulling dev->ctrl.tagset?
> why not check dev->ctrl.tagset?

We could theoretically use either. I don't see any case where we've
allocated dev->tagset.tags but didn't set dev->ctrl.tagset. But I
just kept the same check we had before, just moved it into a helper
function.