Skip to content
Permalink
Browse files
tg3: Avoid NULL pointer dereference in netif_device_attach()
Similar to commit<1b0ff89852d7>("tg3: Avoid NULL pointer dereference in tg3_io_error_detected()")
This patch avoids NULL pointer dereference add a check for netdev being NULL on tg3_resume().

Signed-off-by: Defang Bo <bodefang@126.com>
  • Loading branch information
Defang Bo authored and intel-lab-lkp committed Oct 19, 2020
1 parent 7cf726a commit 3f835547ea4fb78c40a11c129412f724994829fe
Showing 1 changed file with 1 addition and 1 deletion.
@@ -18108,7 +18108,7 @@ static int tg3_resume(struct device *device)

rtnl_lock();

if (!netif_running(dev))
if (!netdev || !netif_running(dev))
goto unlock;

netif_device_attach(dev);

0 comments on commit 3f83554

Please sign in to comment.