PR kern/52039: use same safeguard as for the 82578
This commit is contained in:
parent
5c6be7789e
commit
b6ca960363
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_wm.c,v 1.496 2017/03/03 16:48:55 knakahara Exp $ */
|
||||
/* $NetBSD: if_wm.c,v 1.497 2017/03/08 08:00:09 kardel Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
|
||||
|
@ -84,7 +84,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.496 2017/03/03 16:48:55 knakahara Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.497 2017/03/08 08:00:09 kardel Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_net_mpsafe.h"
|
||||
|
@ -13178,7 +13178,7 @@ wm_enable_wakeup(struct wm_softc *sc)
|
|||
|
||||
/* Assume that the PHY is copper */
|
||||
child = LIST_FIRST(&sc->sc_mii.mii_phys);
|
||||
if (child->mii_mpd_rev <= 2)
|
||||
if ((child != NULL) && (child->mii_mpd_rev <= 2))
|
||||
sc->sc_mii.mii_writereg(sc->sc_dev, 1,
|
||||
(768 << 5) | 25, 0x0444); /* magic num */
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue