diff options
author | Mark Einon <mark.einon@gmail.com> | 2011-10-10 15:21:12 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-10-11 16:10:30 (GMT) |
commit | 33fd472ee7b98ac187f0fcee33d97a187bdbaa08 (patch) | |
tree | 6a425b6abe41906a09b8e41af22b9ac99eea887c | |
parent | 6617c3698778ae896deb89804f7ba8efb4d2252d (diff) | |
download | linux-fsl-qoriq-33fd472ee7b98ac187f0fcee33d97a187bdbaa08.tar.xz |
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: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/et131x/et131x_initpci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/et131x/et131x_initpci.c b/drivers/staging/et131x/et131x_initpci.c index 9b2dc55..45ce832 100644 --- a/drivers/staging/et131x/et131x_initpci.c +++ b/drivers/staging/et131x/et131x_initpci.c @@ -485,7 +485,7 @@ static void et131x_adjust_link(struct net_device *netdev) 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 * so, disable it because we will not be able @@ -501,7 +501,7 @@ static void et131x_adjust_link(struct net_device *netdev) "Link down - cable problem ?\n"); adapter->boot_coma = 0; - if (phydev && phydev->speed == SPEED_10) { + if (phydev->speed == SPEED_10) { /* NOTE - Is there a way to query this without * TruePHY? * && TRU_QueryCoreType(adapter->hTruePhy, 0) == |