Skip to content

Commit

Permalink
uio: uio_dmem_genirq: check the return value of devm_kasprintf()
Browse files Browse the repository at this point in the history
devm_kasprintf() can fail so check its return value and bail-out on no
memory.

Fixes: 52e2dc2 ("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>
  • Loading branch information
Bartosz Golaszewski authored and Greg Kroah-Hartman committed Jan 10, 2025
1 parent efc7ae3 commit a6e2087
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/uio/uio_dmem_genirq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

Expand Down

0 comments on commit a6e2087

Please sign in to comment.