bnxt_en: Fix call to hardware monitoring event handler
PATCH 1/1 bnxt_en: Fix call to hardware monitoring event handler
The first parameter of hwmon_notify_event() is supposed to be the hardware monitoring device. The bnxt driver calls it with the platform device as first parameter instead. This API break results in undefined behavior and may result in a crash.
Pass the hardware monitoring device as parameter instead to fix the problem.
--- drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +1 -1
@@ -40,7 +40,7 @@ void bnxt_hwmon_notify_event(struct bnxt *bp)return ; } -hwmon_notify_event (&bp->pdev->dev, hwmon_temp, attr,0 ); +hwmon_notify_event (bp->hwmon_dev, hwmon_temp, attr,0 ); }static int bnxt_hwrm_temp_query (struct bnxt *bp,u8 *temp)
Signature · 1 line
2.45.2
Quoted 6 lines · Guenter Roeck
The first parameter of
hwmon_notify_event()is supposed to be the hardware monitoring device. The bnxt driver calls it with the platform device as first parameter instead. This API break results in undefined behavior and may result in a crash.
Quoted 6 lines
Pass the hardware monitoring device as parameter instead to fix the problem.
Fixes a19b4801457b0 ("bnxt_en: Event handler for Thermal event")Cc Kalesh AP <[email protected]>Signed-off-by Guenter Roeck <[email protected]>
Thank you for the fix, LGTM!
Signature · 2 lines
Regards, Kalesh AP
Quoted 20 lines · Guenter Roeck
The first parameter of
hwmon_notify_event()is supposed to be the hardware monitoring device. The bnxt driver calls it with the platform device as first parameter instead. This API break results in undefined behavior and may result in a crash.Pass the hardware monitoring device as parameter instead to fix the problem.
Fixes a19b4801457b0 ("bnxt_en: Event handler for Thermal event")Cc Kalesh AP <[email protected]>Signed-off-by Guenter Roeck <[email protected]>--- drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +0
-0
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c void bnxt_hwmon_notify_event(struct bnxt *bp) · line 46
Quoted 8 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +1
-1@@ -40,7 +40,7 @@ void bnxt_hwmon_notify_event(struct bnxt *bp)return ; } -hwmon_notify_event (&bp->pdev->dev, hwmon_temp, attr,0 ); +hwmon_notify_event (bp->hwmon_dev, hwmon_temp, attr,0 ); }static int bnxt_hwrm_temp_query (struct bnxt *bp,u8 *temp)
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Thu, 20 Aug 2026 21:45:12 -0700 you wrote:
The first parameter of
hwmon_notify_event()is supposed to be the hardware monitoring device. The bnxt driver calls it with the platform device as first parameter instead. This API break results in undefined behavior and may result in a crash.Pass the hardware monitoring device as parameter instead to fix the problem.
[...]
Here is the summary with links:
- bnxt_en: Fix call to hardware monitoring event handler
https://git.kernel.org/netdev/net/c/622d698df423
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html