Skip to content

Commit 0816e0c

Browse files
emuslndavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent df8aeaa commit 0816e0c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/pensando/ionic/ionic_dev.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ static void ionic_watchdog_cb(struct timer_list *t)
1919
mod_timer(&ionic->watchdog_timer,
2020
round_jiffies(jiffies + ionic->watchdog_period));
2121

22+
if (!ionic->lif)
23+
return;
24+
2225
hb = ionic_heartbeat_check(ionic);
2326

24-
if (hb >= 0 && ionic->lif)
27+
if (hb >= 0)
2528
ionic_link_status_check_request(ionic->lif, false);
2629
}
2730

0 commit comments

Comments
 (0)