Re: [PATCH v3] backlight: pm8941: Add NULL check in wled_configure()

2025-04-05 Thread Markus Elfring
> devm_kasprintf() return NULL if memory allocation fails. Currently, … call? failed? > Add NULL check after devm_kasprintf() to prevent this issue. Do you propose to improve this function implementation a bit more? Regards, Markus

Re: [PATCH v3] backlight: pm8941: Add NULL check in wled_configure()

2025-04-04 Thread Daniel Thompson
On Tue, Apr 01, 2025 at 04:29:50PM +0800, Henry Martin wrote: > The function wled_configure() uses devm_kasprintf() without checking for > allocation failures, which could lead to NULL pointer dereferences. > > Add proper error handling when devm_kasprintf() fails by: > - Returning -ENOMEM immediat

Re: [PATCH v3] backlight: pm8941: Add NULL check in wled_configure()

2025-04-01 Thread Daniel Thompson
On Tue, Apr 01, 2025 at 10:57:37AM +0800, Henry Martin wrote: > devm_kasprintf() returns NULL when memory allocation fails. Currently, > wled_configure() does not check for this case, which results in a NULL > pointer dereference. > > Add NULL check after devm_kasprintf() to prevent this issue. > >

[PATCH v3] backlight: pm8941: Add NULL check in wled_configure()

2025-04-01 Thread Henry Martin
The function wled_configure() uses devm_kasprintf() without checking for allocation failures, which could lead to NULL pointer dereferences. Add proper error handling when devm_kasprintf() fails by: - Returning -ENOMEM immediately - Ensuring no resources are left allocated (none need cleanup in th

[PATCH v3] backlight: pm8941: Add NULL check in wled_configure()

2025-03-31 Thread Henry Martin
Thanks for your review. No further improvements needed for this implementation - it already handles all error cases appropriately. Best regards, Henry

[PATCH v3] backlight: pm8941: Add NULL check in wled_configure()

2025-03-31 Thread Henry Martin
devm_kasprintf() returns NULL when memory allocation fails. Currently, wled_configure() does not check for this case, which results in a NULL pointer dereference. Add NULL check after devm_kasprintf() to prevent this issue. Fixes: f86b77583d88 ("backlight: pm8941: Convert to using %pOFn instead o