Skip to content

Commit c8222ef

Browse files
WhiteFox-Projectkrzk
authored andcommitted
soc: samsung: exynos-chipid: Add NULL pointer check in exynos_chipid_probe()
soc_dev_attr->revision could be NULL, thus, a pointer check is added to prevent potential NULL pointer dereference. This is similar to the fix in commit 3027e7b ("ice: Fix some null pointer dereference issues in ice_ptp.c"). This issue is found by our static analysis tool. Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com> Link: https://lore.kernel.org/r/20250212213518.69432-1-chenyuan0y@gmail.com Fixes: 3253b7b ("soc: samsung: Add exynos chipid driver support") Cc: <stable@vger.kernel.org> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
1 parent 1fdadc8 commit c8222ef

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/soc/samsung/exynos-chipid.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ static int exynos_chipid_probe(struct platform_device *pdev)
134134

135135
soc_dev_attr->revision = devm_kasprintf(&pdev->dev, GFP_KERNEL,
136136
"%x", soc_info.revision);
137+
if (!soc_dev_attr->revision)
138+
return -ENOMEM;
137139
soc_dev_attr->soc_id = product_id_to_soc_id(soc_info.product_id);
138140
if (!soc_dev_attr->soc_id) {
139141
pr_err("Unknown SoC\n");

0 commit comments

Comments
 (0)