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

Markus Elfring Markus.Elfring at web.de
Mon Mar 31 16:48:34 UTC 2025


> devm_kasprintf() return NULL if memory allocation fails. Currently,

                 call?                               failed?


> wled_configure() does not check for this case, leading to a possible NULL
> pointer dereference.

You may omit the word “possible” in such a change description.
(Would questionable data processing happen in other function implementations?)


> Add NULL check after devm_kasprintf() to prevent this issue.

Do you complete the error/exception handling also with the statement “return -ENOMEM;”?

Regards,
Markus


More information about the dri-devel mailing list