Commit 29879711 authored by Charles Han's avatar Charles Han Committed by liukai
Browse files

clk: clk-apple-nco: Add NULL check in applnco_probe

stable inclusion
from stable-v6.6.64
commit 72ea9a7e9e260aa39f9d1c9254cf92adfb05c4f5
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBDHGX
CVE: CVE-2024-53154

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=72ea9a7e9e260aa39f9d1c9254cf92adfb05c4f5



--------------------------------

[ Upstream commit 969c765e2b508cca9099d246c010a1e48dcfd089 ]

Add NULL check in applnco_probe, to handle kernel NULL pointer
dereference error.

Fixes: 6641057d ("clk: clk-apple-nco: Add driver for Apple NCO")
Signed-off-by: default avatarCharles Han <hanchunchao@inspur.com>
Link: https://lore.kernel.org/r/20241114072820.3071-1-hanchunchao@inspur.com


Reviewed-by: default avatarMartin Povišer <povik+lin@cutebit.org>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed—off-by: default avatarLiu Kai <liukai284@huawei.com>
parent 8fc66242
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -297,6 +297,9 @@ static int applnco_probe(struct platform_device *pdev)
		memset(&init, 0, sizeof(init));
		init.name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
						"%s-%d", np->name, i);
		if (!init.name)
			return -ENOMEM;

		init.ops = &applnco_ops;
		init.parent_data = &pdata;
		init.num_parents = 1;