lists.openwall.net   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  linux-cve-announce  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]
Message-ID: <20250410110421.77580-1-hanchunchao@inspur.com>
Date: Thu, 10 Apr 2025 19:04:20 +0800
From: Charles Han <hanchunchao@...pur.com>
To: <s.nawrocki@...sung.com>, <a.swigon@...sung.com>, <djakov@...nel.org>,
	<krzk@...nel.org>, <alim.akhtar@...sung.com>, <cw00.choi@...sung.com>
CC: <linux-pm@...r.kernel.org>, <linux-samsung-soc@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
	Charles Han <hanchunchao@...pur.com>
Subject: [PATCH] interconnect: samsung: Add NULL check in exynos_generic_icc_probe

devm_kasprintf() can return a NULL pointer on failure,but this
returned value in exynos_generic_icc_probe() is not checked.
Add NULL check in exynos_generic_icc_probe(), to handle kernel NULL
pointer dereference error.

Fixes: 2f95b9d5cf0b ("interconnect: Add generic interconnect driver for Exynos SoCs")
Signed-off-by: Charles Han <hanchunchao@...pur.com>
---
 drivers/interconnect/samsung/exynos.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/interconnect/samsung/exynos.c b/drivers/interconnect/samsung/exynos.c
index 9e041365d909..f3568f0d92d1 100644
--- a/drivers/interconnect/samsung/exynos.c
+++ b/drivers/interconnect/samsung/exynos.c
@@ -134,6 +134,11 @@ static int exynos_generic_icc_probe(struct platform_device *pdev)
 	priv->node = icc_node;
 	icc_node->name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%pOFn",
 					bus_dev->of_node);
+	if (!icc_node->name) {
+		devm_kfree(&pdev->dev, priv);
+		return -ENOMEM;
+	}
+
 	if (of_property_read_u32(bus_dev->of_node, "samsung,data-clock-ratio",
 				 &priv->bus_clk_ratio))
 		priv->bus_clk_ratio = EXYNOS_ICC_DEFAULT_BUS_CLK_RATIO;
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ