Skip to contentSkip to conversation

net: usb: rtl8150 fix unintiatilzed variables in rtl8150_get_link_ksettings

PATCH Applied Oliver Neukum 3 participants 3 messages Jun 19, 2024 – Jun 20, 2024

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

PATCH 1/1 net: usb: rtl8150 fix unintiatilzed variables in rtl8150_get_link_ksettings

This functions retrieves values by passing a pointer. As the function that retrieves them can fail before touching the pointers, the variables must be initialized.

---
 drivers/net/usb/rtl8150.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/usb/rtl8150.c +2 -1
index 97afd7335d86..01a3b2417a54 100644
@@ -778,7 +778,8 @@ static int rtl8150_get_link_ksettings(struct net_device *netdev,
 				      struct ethtool_link_ksettings *ecmd)
 {
 	rtl8150_t *dev = netdev_priv(netdev);
-	short lpa, bmcr;
+	short lpa = 0;
+	short bmcr = 0;
 	u32 supported;
 
 	supported = (SUPPORTED_10baseT_Half |
Signature · 1 line
2.45.1
maintainer
#1 lore raw
Quoted 3 lines · Oliver Neukum

This functions retrieves values by passing a pointer. As the function that retrieves them can fail before touching the pointers, the variables must be initialized.

ACK.

Petko

Quoted 24 lines
---
 drivers/net/usb/rtl8150.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/usb/rtl8150.c +2 -1
index 97afd7335d86..01a3b2417a54 100644
@@ -778,7 +778,8 @@ static int rtl8150_get_link_ksettings(struct net_device *netdev,
 				      struct ethtool_link_ksettings *ecmd)
 {
 	rtl8150_t *dev = netdev_priv(netdev);
-	short lpa, bmcr;
+	short lpa = 0;
+	short bmcr = 0;
 	u32 supported;
 
 	supported = (SUPPORTED_10baseT_Half |
Signature · 1 line
2.45.1
#2 lore raw
In reply to Oliver Neukum
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 8 lines · On Wed, 19 Jun 2024 15:28:03 +0200 you wrote:

This functions retrieves values by passing a pointer. As the function that retrieves them can fail before touching the pointers, the variables must be initialized.

[...]

Here is the summary with links:
- [net] net: usb: rtl8150 fix unintiatilzed variables in rtl8150_get_link_ksettings

    https://git.kernel.org/netdev/net/c/fba383985354

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html