Prevent a panic when a driver provides bogus debugnet parameters
This is just a bandaid; we should fix the driver(s) too. Introduced in r353685. PR: 241403 X-MFC-With: r353685 Reported by: np and others
This commit is contained in:
parent
4eb815fa6a
commit
cae3e20483
@ -826,6 +826,15 @@ debugnet_any_ifnet_update(struct ifnet *ifp)
|
||||
nmbuf = ncl * (4 + nrxr);
|
||||
ncl *= nrxr;
|
||||
|
||||
/*
|
||||
* Bandaid for drivers that (incorrectly) advertise LinkUp before their
|
||||
* dn_init method is available.
|
||||
*/
|
||||
if (nmbuf == 0 || ncl == 0 || clsize == 0) {
|
||||
printf("%s: Bad dn_init result from %s (ifp %p), ignoring.\n",
|
||||
__func__, if_name(ifp), ifp);
|
||||
return;
|
||||
}
|
||||
dn_maybe_reinit_mbufs(nmbuf, ncl, clsize);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user