summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/pensando/ionic
diff options
context:
space:
mode:
authorShannon Nelson <snelson@pensando.io>2020-09-30 10:48:28 -0700
committerDavid S. Miller <davem@davemloft.net>2020-09-30 15:11:09 -0700
commit0816e0c8188e7db85a7284d3f0f456947ebb049c (patch)
treed60af5ae9a50e314c2ec976c267932e6fcadef8e /drivers/net/ethernet/pensando/ionic
parentdf8aeaa8268f11dc3c2d0975954624cf324eab15 (diff)
ionic: prevent early watchdog check
In one corner case scenario, the driver device lif setup can get delayed such that the ionic_watchdog_cb() timer goes off before the ionic->lif is set, thus causing a NULL pointer panic. We catch the problem by checking for a NULL lif just a little earlier in the callback. Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/pensando/ionic')
-rw-r--r--drivers/net/ethernet/pensando/ionic/ionic_dev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.c b/drivers/net/ethernet/pensando/ionic/ionic_dev.c
index 16b6b65e8319..545c99b15df8 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_dev.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.c
@@ -19,9 +19,12 @@ static void ionic_watchdog_cb(struct timer_list *t)
mod_timer(&ionic->watchdog_timer,
round_jiffies(jiffies + ionic->watchdog_period));
+ if (!ionic->lif)
+ return;
+
hb = ionic_heartbeat_check(ionic);
- if (hb >= 0 && ionic->lif)
+ if (hb >= 0)
ionic_link_status_check_request(ionic->lif, false);
}