Skip to contentSkip to conversation

Missing null check in rza2_gpio_register

DISCUSSION henry via Bugspray Bot 1 participant 2 messages Mar 28, 2025 – Apr 27, 2025 GPIO

lore
Share & tools
lore
#0 lore raw

henry writes via Kernel.org Bugzilla:

pinctrl: renesas: rza2: Add null check in the rza2_gpio_register

When devm_kasprintf fails, it returns a null pointer. However, this return value is not properly checked in the function rza2_gpio_register.

A check should be added after the devm_kasprintf call to prevent potential null pointer dereference issues.

CODE:

	chip.label = devm_kasprintf(priv->dev, GFP_KERNEL, "%pOFn", np);
	chip.parent = priv->dev;
	chip.ngpio = priv->npins;

View: https://bugzilla.kernel.org/show_bug.cgi?id=219946#c0
You can reply to this message to join the discussion.

Signature · 2 lines
Deet-doot-dot, I am a bot.
Kernel.org Bugzilla (bugspray 0.1-dev)
#1 lore raw

Andy Shevchenko writes via Kernel.org Bugzilla:

Alredy fixed in the https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/pinctrl/renesas/pinctrl-rza2.c?id=f752ee5b5b86b5f88a5687c9eb0ef9b39859b908.

View: https://bugzilla.kernel.org/show_bug.cgi?id=219946#c1
You can reply to this message to join the discussion.

Signature · 2 lines
Deet-doot-dot, I am a bot.
Kernel.org Bugzilla (bugspray 0.1-dev)