Commit 0816e0c8 authored by Shannon Nelson's avatar Shannon Nelson Committed by David S. Miller

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: default avatarShannon Nelson <snelson@pensando.io>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent df8aeaa8
...@@ -19,9 +19,12 @@ static void ionic_watchdog_cb(struct timer_list *t) ...@@ -19,9 +19,12 @@ static void ionic_watchdog_cb(struct timer_list *t)
mod_timer(&ionic->watchdog_timer, mod_timer(&ionic->watchdog_timer,
round_jiffies(jiffies + ionic->watchdog_period)); round_jiffies(jiffies + ionic->watchdog_period));
if (!ionic->lif)
return;
hb = ionic_heartbeat_check(ionic); hb = ionic_heartbeat_check(ionic);
if (hb >= 0 && ionic->lif) if (hb >= 0)
ionic_link_status_check_request(ionic->lif, false); ionic_link_status_check_request(ionic->lif, false);
} }
......
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