DMA Engine development
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@oss.nxp.com>
To: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>, Vinod Koul <vkoul@kernel.org>,
	Frank Li <Frank.Li@kernel.org>, Fenghua Yu <fenghuay@nvidia.com>,
	Shuai Xue <xueshuai@linux.alibaba.com>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	Steve Wahl <steve.wahl@hpe.com>
Subject: Re: [PATCH 1/6] dmaengine: idxd: Do not call destroy_workqueue with null idxd->wq
Date: Tue, 13 Oct 2026 09:55:03 -0500	[thread overview]
Message-ID: <as5GR-3kOfI47wQc@SMW015318> (raw)
In-Reply-To: <20261012-wt-idxd-fixes-v1-1-30a35a445077@intel.com>

On Mon, Oct 12, 2026 at 02:38:04PM -0700, Vinicius Costa Gomes wrote:
> From: Steve Wahl <steve.wahl@hpe.com>
>
> Error paths within idxd_pci_probe_alloc and related functions end up
> calling destroy_workqueue with a null pointer, from

all funciton need (), include subject.

destroy_workqueue()

Frank

> idxd_conf_device_release via put_device, because that allocation has
> not yet occurred when the error is hit.
>
> This was encountered running in a kexec'd kdump kernel with reduced
> resources, causing the "Device is HALTED!" branch in
> idxd_device_init_reset to be taken.
>
> In idxd_conf_device_release, check that the workqueue has been
> allocated before trying to destroy it.
>
> Fixes: 3d33de353b1f ("dmaengine: idxd: Fix not releasing workqueue on .release()")
> Signed-off-by: Steve Wahl <steve.wahl@hpe.com>
> Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
> ---
>  drivers/dma/idxd/sysfs.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c
> index 6d251095c350..d5ffc641c856 100644
> --- a/drivers/dma/idxd/sysfs.c
> +++ b/drivers/dma/idxd/sysfs.c
> @@ -1836,7 +1836,8 @@ static void idxd_conf_device_release(struct device *dev)
>  {
>  	struct idxd_device *idxd = confdev_to_idxd(dev);
>
> -	destroy_workqueue(idxd->wq);
> +	if (idxd->wq)
> +		destroy_workqueue(idxd->wq);
>  	kfree(idxd->groups);
>  	bitmap_free(idxd->wq_enable_map);
>  	kfree(idxd->wqs);
>
> --
> 2.56.0
>

  reply	other threads:[~2026-10-13 14:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-12 21:38 [PATCH 0/6] dmaengine: idxd: More error handling fixes Vinicius Costa Gomes
2026-10-12 21:38 ` [PATCH 1/6] dmaengine: idxd: Do not call destroy_workqueue with null idxd->wq Vinicius Costa Gomes
2026-10-13 14:55   ` Frank Li [this message]
2026-10-13 17:18   ` Dave Jiang
2026-10-12 21:38 ` [PATCH 2/6] dmaengine: idxd: fix duplicate memory frees on initialization error path Vinicius Costa Gomes
2026-10-13 14:57   ` Frank Li
2026-10-13 17:21   ` Dave Jiang
2026-10-12 21:38 ` [PATCH 3/6] dmaengine: idxd: Fix potential double free on probe " Vinicius Costa Gomes
2026-10-13 17:30   ` Dave Jiang
2026-10-12 21:38 ` [PATCH 4/6] dmaengine: idxd: Fix unwind bounds in device registration error paths Vinicius Costa Gomes
2026-10-12 21:47   ` sashiko-bot
2026-10-12 21:38 ` [PATCH 5/6] dmaengine: idxd: Fix error code handling in idxd_cdev_open() Vinicius Costa Gomes
2026-10-12 21:50   ` sashiko-bot
2026-10-12 21:38 ` [PATCH 6/6] dmaengine: idxd: Do not release interrupt handles on terminate_all Vinicius Costa Gomes
2026-10-12 21:58   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=as5GR-3kOfI47wQc@SMW015318 \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@kernel.org \
    --cc=dave.jiang@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=fenghuay@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=steve.wahl@hpe.com \
    --cc=vinicius.gomes@intel.com \
    --cc=vkoul@kernel.org \
    --cc=xueshuai@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox