mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-20 15:43:16 +00:00
fix a page fault that it occurred during ifp is NULL. This bug happens
when NDIS driver's initialization is failed and NDIS driver's trying to call NdisWriteErrorLogEntry().
This commit is contained in:
parent
3c463a49eb
commit
1f22fabdfb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179720
@ -1018,7 +1018,7 @@ NdisWriteErrorLogEntry(ndis_handle adapter, ndis_error_code code,
|
||||
sc = device_get_softc(dev);
|
||||
ifp = sc->ifp;
|
||||
|
||||
if (ifp->if_flags & IFF_DEBUG) {
|
||||
if (ifp != NULL && ifp->if_flags & IFF_DEBUG) {
|
||||
error = pe_get_message((vm_offset_t)drv->dro_driverstart,
|
||||
code, &str, &i, &flags);
|
||||
if (error == 0) {
|
||||
@ -1036,7 +1036,7 @@ NdisWriteErrorLogEntry(ndis_handle adapter, ndis_error_code code,
|
||||
device_printf (dev, "NDIS ERROR: %x (%s)\n", code,
|
||||
str == NULL ? "unknown error" : str);
|
||||
|
||||
if (ifp->if_flags & IFF_DEBUG) {
|
||||
if (ifp != NULL && ifp->if_flags & IFF_DEBUG) {
|
||||
device_printf (dev, "NDIS NUMERRORS: %x\n", numerrors);
|
||||
va_start(ap, numerrors);
|
||||
for (i = 0; i < numerrors; i++)
|
||||
|
Loading…
Reference in New Issue
Block a user