Skip to content

Commit fba3839

Browse files
oneukumkuba-moo
authored andcommitted
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. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: [email protected] Signed-off-by: Oliver Neukum <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 48dea8f commit fba3839

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/usb/rtl8150.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,8 @@ static int rtl8150_get_link_ksettings(struct net_device *netdev,
778778
struct ethtool_link_ksettings *ecmd)
779779
{
780780
rtl8150_t *dev = netdev_priv(netdev);
781-
short lpa, bmcr;
781+
short lpa = 0;
782+
short bmcr = 0;
782783
u32 supported;
783784

784785
supported = (SUPPORTED_10baseT_Half |

0 commit comments

Comments
 (0)