Commit d9fa3aae authored by Charles Han's avatar Charles Han Committed by Sebastian Reichel
Browse files

power: supply: cpcap-charger: Fix null check for power_supply_get_by_name



In the cpcap_usb_detect() function, the power_supply_get_by_name()
function may return `NULL` instead of an error pointer.
To prevent potential null pointer dereferences, Added a null check.

Fixes: eab4e6d9 ("power: supply: cpcap-charger: get the battery inserted infomation from cpcap-battery")
Signed-off-by: default avatarCharles Han <hanchunchao@inspur.com>
Link: https://lore.kernel.org/r/20250519024741.5846-1-hanchunchao@inspur.com


Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 7cf88213
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment