[PATCHv2] nvme: always initialize known command effects

Christoph Hellwig hch at lst.de
Mon Jan 23 08:35:36 PST 2023


On Mon, Jan 23, 2023 at 09:29:35AM -0700, Keith Busch wrote:
> On Mon, Jan 23, 2023 at 03:54:31PM +0530, Kanchan Joshi wrote:
> > On Thu, Jan 19, 2023 at 08:41:28AM -0800, Keith Busch wrote:
> > > +	if (!ctrl->effects) {
> > > +		ctrl->effects = kzalloc(sizeof(*ctrl->effects), GFP_KERNEL);
> > 
> > ctrl->effects is not getting freed if controller does not support the
> > commands-supported-and-effects log page?
> 
> Right. If the controller doesn't support it, the driver will make one up
> with some sane defaults. The point of this patch is that we don't want
> to re-construct the defaults for each passthrough command so we need to
> store the defaults somewhere.

But it never ends up beeing freed even when the controller is torn
down as it never gets added to ctrl->cels.



More information about the Linux-nvme mailing list