Skip to content

Commit

Permalink
staging: et131x: Fix et131x smatch issues
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Einon authored and Greg Kroah-Hartman committed Oct 11, 2011
1 parent 6617c36 commit 33fd472
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/et131x/et131x_initpci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) ==
Expand Down

0 comments on commit 33fd472

Please sign in to comment.