[PATCH 3/3] firmware: arm_scmi: Unregister notifier on enable failure

Peng Fan peng.fan at oss.nxp.com
Wed Oct 28 06:51:17 PDT 2026


On Wed, Oct 28, 2026 at 01:05:02PM +0000, Sudeep Holla wrote:
>scmi_notifier_register() adds the caller's notifier block before
>enabling the corresponding event at the platform.
>
>If enablement fails, the caller receives an error and can free its
>notifier block. A concurrent registration can retain and later enable
>the handler, leaving the failed caller's block in its notification
>chain. Event delivery can then dereference the freed block.
>
>Remove the notifier block before dropping the handler reference when
>event enablement fails.
>
>Reported-by: Sashiko <sashiko-bot at kernel.org>
>Closes: https://sashiko.dev/#/bug/linux-c3c9437c-ba1a-4db6-837f-cb0950d89018
>Fixes: e7c215f358a3 ("firmware: arm_scmi: Add notification callbacks-registration")
>Signed-off-by: Sudeep Holla <sudeep.holla at kernel.org>

Reviewed-by: Peng Fan <peng.fan at nxp.com>



More information about the linux-arm-kernel mailing list