]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ionic: prevent early watchdog check
authorShannon Nelson <snelson@pensando.io>
Wed, 30 Sep 2020 17:48:28 +0000 (10:48 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Sep 2020 22:11:09 +0000 (15:11 -0700)
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>
drivers/net/ethernet/pensando/ionic/ionic_dev.c

index 16b6b65e83194db2c04df9191d220f7552954615..545c99b15df8e02fca4b5b4c7f87ee60990f2907 100644 (file)
@@ -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);
 }