[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20241202181703.28546-1-brgl@bgdev.pl>
Date: Mon, 2 Dec 2024 19:17:03 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Rob Herring <robh@...nel.org>
Cc: linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: [PATCH] uio: uio_dmem_genirq: check the return value of devm_kasprintf()
From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
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@...aro.org>
---
drivers/uio/uio_dmem_genirq.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/uio/uio_dmem_genirq.c b/drivers/uio/uio_dmem_genirq.c
index c70dd81bfc61f..31aa75110ba59 100644
--- a/drivers/uio/uio_dmem_genirq.c
+++ b/drivers/uio/uio_dmem_genirq.c
@@ -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";
}
--
2.45.2
Powered by blists - more mailing lists