Bug 219946 - Missing null check in rza2_gpio_register
Summary: Missing null check in rza2_gpio_register
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: GPIO/Pin Control (show other bugs)
Hardware: All Linux
: P3 normal
Assignee: GPIO/Pin Control virtual assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-28 10:11 UTC by henry
Modified: 2025-03-28 10:11 UTC (History)
0 users

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description henry 2025-03-28 10:11:28 UTC
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;

Note You need to log in before you can comment on or make changes to this bug.