Bug 219946

Summary: Missing null check in rza2_gpio_register
Product: Drivers Reporter: henry (bsdhenrymartin)
Component: GPIO/Pin ControlAssignee: GPIO/Pin Control virtual assignee (drivers_gpio_pincontrol)
Status: NEW ---    
Severity: normal    
Priority: P3    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

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;