In the Linux kernel, the following vulnerability has been resolved: leds: ktd2692: Pass context to regulator cleanup regulator_disable_action() retrieves the driver context from device driver data. However, ktd2692_parse_dt() registers the action before ktd2692_probe() stores the context with platform_set_drvdata(). If devm_add_action_or_reset() cannot allocate the action, it invokes the callback immediately. A later probe failure also invokes it during managed-resource unwinding. Both paths dereference a NULL context. Pass the already allocated context directly to the action and retain the device pointer in it for error reporting. The context is allocated before the action is registered, so reverse-order devres unwinding keeps it alive through the callback. This issue was identified during our ongoing static-analysis research while reviewing kernel code.
https://git.kernel.org/stable/c/c73e9f04445f361d5f19ca2edfde742ce18348ef
https://git.kernel.org/stable/c/ae1b1eb10dcf4be87f859a38d1ec06d691308232
https://git.kernel.org/stable/c/a752f0d93af0488f5151f60ae3369830225d8425
https://git.kernel.org/stable/c/721a8d471d288febdb35536e1ff30478b0d392b0
https://git.kernel.org/stable/c/63e6c760dab0a59772e55cd7268fdbf4b9025421
https://git.kernel.org/stable/c/3b5ca1a674e9b0145201e4b2b8b47ea174c47d27
https://git.kernel.org/stable/c/2e47c7d093080463eb46fafce7278baf2db5bcd2
https://git.kernel.org/stable/c/1ad96082583e58a8b8848129ff83d4bb74d7702d