Commit 33fd472e authored by Mark Einon's avatar Mark Einon Committed by Greg Kroah-Hartman

staging: et131x: Fix et131x smatch issues

This fixes the following issues:

et131x_initpci.c +488 et131x_adjust_link(45) error: we previously assumed 'phydev' could be null.
et131x_initpci.c +504 et131x_adjust_link(61) warn: variable dereferenced before check 'phydev'
Signed-off-by: default avatarMark Einon <mark.einon@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 6617c369
...@@ -485,7 +485,7 @@ static void et131x_adjust_link(struct net_device *netdev) ...@@ -485,7 +485,7 @@ static void et131x_adjust_link(struct net_device *netdev)
et1310_config_mac_regs2(adapter); et1310_config_mac_regs2(adapter);
} }
if (phydev->link != adapter->link) { if (phydev && phydev->link != adapter->link) {
/* /*
* Check to see if we are in coma mode and if * Check to see if we are in coma mode and if
* so, disable it because we will not be able * so, disable it because we will not be able
...@@ -501,7 +501,7 @@ static void et131x_adjust_link(struct net_device *netdev) ...@@ -501,7 +501,7 @@ static void et131x_adjust_link(struct net_device *netdev)
"Link down - cable problem ?\n"); "Link down - cable problem ?\n");
adapter->boot_coma = 0; adapter->boot_coma = 0;
if (phydev && phydev->speed == SPEED_10) { if (phydev->speed == SPEED_10) {
/* NOTE - Is there a way to query this without /* NOTE - Is there a way to query this without
* TruePHY? * TruePHY?
* && TRU_QueryCoreType(adapter->hTruePhy, 0) == * && TRU_QueryCoreType(adapter->hTruePhy, 0) ==
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment