mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-15 13:15:57 +00:00
uio: uio_dmem_genirq: check the return value of devm_kasprintf()
devm_kasprintf() can fail so check its return value and bail-out on no memory. Fixes: 52e2dc2ce2d8 ("uio: Convert a few more users to using %pOFn instead of device_node.name") Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://lore.kernel.org/r/20241202181703.28546-1-brgl@bgdev.pl Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
efc7ae3f24
commit
a6e2087365
@ -167,6 +167,8 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev)
|
||||
}
|
||||
uioinfo->name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%pOFn",
|
||||
pdev->dev.of_node);
|
||||
if (!uioinfo->name)
|
||||
return -ENOMEM;
|
||||
uioinfo->version = "devicetree";
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user