[PATCH-RFC 1/5] nvme: apple: fix device reference counting

Keith Busch kbusch at kernel.org
Mon Jun 3 16:17:14 PDT 2024


On Mon, Jun 03, 2024 at 04:05:19PM -0700, Keith Busch wrote:
> +static int apple_nvme_probe(struct platform_device *pdev)
> +{
> +	struct apple_nvme *anv;
> +	int ret;
> +
> +	anv = apple_nvme_alloc(pdev);
> +	if (IS_ERR(anv))
> +		return PTR_ERR(anv);
> +
>  	anv->ctrl.admin_q = blk_mq_alloc_queue(&anv->admin_tagset, NULL, NULL);
>  	if (IS_ERR(anv->ctrl.admin_q)) {
>  		ret = -ENOMEM;
> -		goto put_dev;
> +		goto out_uninit_ctrl;
>  	}

Replying to myself: need to add 'anv->ctrl.admin_q = NULL' before the
goto.



More information about the Linux-nvme mailing list