Re: [PATCH] mlxsw: core_hwmon: unregister the hwmon device on event ops failure

From: patchwork-bot+netdevbpf

Date: Fri Nov 06 2026 - 18:10:31 EST


Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@xxxxxxxxxx>:

On Tue, 3 Nov 2026 10:28:50 +0000 you wrote:
> If mlxsw_linecards_event_ops_register() fails, the error path calls
> hwmon_device_unregister() with line_cards[0].hwmon_dev, but that field
> is assigned only after the registration succeeds and is therefore
> still NULL. The hwmon device returned by
> hwmon_device_register_with_groups() is never unregistered, and the
> error path dereferences a NULL device.
>
> [...]

Here is the summary with links:
- mlxsw: core_hwmon: unregister the hwmon device on event ops failure
https://git.kernel.org/netdev/net-next/c/08f643794931

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html