mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-07-05 21:35:46 +02:00
dmaengine: ti: Add NULL check in udma_probe()
[ Upstream commit fd447415e74bccd7362f760d4ea727f8e1ebfe91 ]
devm_kasprintf() returns NULL when memory allocation fails. Currently,
udma_probe() does not check for this case, which results in a NULL
pointer dereference.
Add NULL check after devm_kasprintf() to prevent this issue.
Fixes: 25dcb5dd7b
("dmaengine: ti: New driver for K3 UDMA")
Signed-off-by: Henry Martin <bsdhenrymartin@gmail.com>
Reviewed-by: Nathan Lynch <nathan.lynch@amd.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20250402023900.43440-1-bsdhenrymartin@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
127dfb4f1c
commit
b79e10050d
|
@ -5537,7 +5537,8 @@ static int udma_probe(struct platform_device *pdev)
|
|||
uc->config.dir = DMA_MEM_TO_MEM;
|
||||
uc->name = devm_kasprintf(dev, GFP_KERNEL, "%s chan%d",
|
||||
dev_name(dev), i);
|
||||
|
||||
if (!uc->name)
|
||||
return -ENOMEM;
|
||||
vchan_init(&uc->vc, &ud->ddev);
|
||||
/* Use custom vchan completion handling */
|
||||
tasklet_setup(&uc->vc.task, udma_vchan_complete);
|
||||
|
|
Loading…
Reference in New Issue
Block a user