lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 16 Jan 2022 13:34:50 +0800
        Xiaoke Wang <>
Subject: [PATCH] nvmem: meson-mx-efuse: check the return value of devm_kstrdup()

From: Xiaoke Wang <>

devm_kstrdup() returns pointer to allocated string on success,
NULL on failure. So it is better to check the return value of it.

Signed-off-by: Xiaoke Wang <>
 drivers/nvmem/meson-mx-efuse.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/nvmem/meson-mx-efuse.c b/drivers/nvmem/meson-mx-efuse.c
index 07c9f38..38e6a5f 100644
--- a/drivers/nvmem/meson-mx-efuse.c
+++ b/drivers/nvmem/meson-mx-efuse.c
@@ -211,6 +211,9 @@ static int meson_mx_efuse_probe(struct platform_device *pdev)
 	efuse-> = devm_kstrdup(&pdev->dev, drvdata->name,
+	if (!efuse->
+		return -ENOMEM;
 	efuse->config.owner = THIS_MODULE;
 	efuse-> = &pdev->dev;
 	efuse->config.priv = efuse;

Powered by blists - more mailing lists