Bug 219948

Summary: Missing null check in tps6594_pfsm_probe
Product: Drivers Reporter: henry (bsdhenrymartin)
Component: PlatformAssignee: drivers_platform (drivers_platform)
Status: NEW ---    
Severity: normal    
Priority: P3    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

Description henry 2025-03-28 10:40:52 UTC
misc: tps6594-pfsm: Add null check in the tps6594_pfsm_probe

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

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

CODE:
	pfsm->miscdev.minor = MISC_DYNAMIC_MINOR;
	pfsm->miscdev.name = devm_kasprintf(dev, GFP_KERNEL, "pfsm-%ld-0x%02x",
					    tps->chip_id, tps->reg);
	pfsm->miscdev.fops = &tps6594_pfsm_fops;
	pfsm->miscdev.parent = dev->parent;