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. > >