[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aJnKFa9YHc-pYori@stanley.mountain>
Date: Mon, 11 Aug 2025 13:46:45 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Colin Ian King <colin.i.king@...il.com>,
Shuai Xue <xueshuai@...ux.alibaba.com>
Cc: Vinicius Costa Gomes <vinicius.gomes@...el.com>,
Dave Jiang <dave.jiang@...el.com>, Vinod Koul <vkoul@...nel.org>,
Fenghua Yu <fenghuay@...dia.com>, dmaengine@...r.kernel.org,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] dmaengine: idxd: Fix dereference on uninitialized
pointer conf_dev
Actually the error handling wasn't so bad. It's just that one error path
which is buggy. The idxd->max_wqs variable probably can't be <= 0 (I
haven't checked, but I assume it can't). Anyway, I've sent my prefered
fix but an alternative would be to do the below.
regards,
dan carpenter
diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
index 35bdefd3728b..b603d7dacf3a 100644
--- a/drivers/dma/idxd/init.c
+++ b/drivers/dma/idxd/init.c
@@ -195,6 +195,7 @@ static int idxd_setup_wqs(struct idxd_device *idxd)
for (i = 0; i < idxd->max_wqs; i++) {
wq = kzalloc_node(sizeof(*wq), GFP_KERNEL, dev_to_node(dev));
if (!wq) {
+ conf_dev = NULL;
rc = -ENOMEM;
goto err;
}
Powered by blists - more mailing lists