mirror of
https://github.com/torvalds/linux
synced 2024-09-06 09:51:23 +00:00
wifi: iwlegacy: Add null pointer check to il_leds_init()
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Cc: Kunwu Chan <kunwu.chan@hotmail.com> Signed-off-by: Kunwu Chan <chentao@kylinos.cn> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20231211033019.238149-1-chentao@kylinos.cn
This commit is contained in:
parent
0a999d82b7
commit
afd549903e
|
@ -541,6 +541,9 @@ il_leds_init(struct il_priv *il)
|
|||
|
||||
il->led.name =
|
||||
kasprintf(GFP_KERNEL, "%s-led", wiphy_name(il->hw->wiphy));
|
||||
if (!il->led.name)
|
||||
return;
|
||||
|
||||
il->led.brightness_set = il_led_brightness_set;
|
||||
il->led.blink_set = il_led_blink_set;
|
||||
il->led.max_brightness = 1;
|
||||
|
|
Loading…
Reference in a new issue