Skip to contentSkip to conversation

bnxt_en: Fix call to hardware monitoring event handler

PATCH Applied Guenter Roeck 4 participants 4 messages Aug 21 – Aug 22

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

Fixes a19b4801457b0 ("bnxt_en: Event handler for Thermal event")
Cc Kalesh AP <[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 +1 -1
index de3427c6c6aa..faed0cf726e1 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw
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]>

Thank you for the fix, LGTM!

Signature · 2 lines
Regards,
Kalesh AP
Reviewed-by on v1 1/1
#2 lore raw
In reply to Guenter Roeck
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]>
---
  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
index de3427c6c6aa..faed0cf726e1 100644

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)
#3 lore raw
In reply to Guenter Roeck
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