Move the NULL check before the dereferencing try
CID 5968
This commit is contained in:
@@ -385,9 +385,9 @@ wlan_if_l2com_alloc(void* data)
|
|||||||
struct ifnet* ifp = (struct ifnet*)data;
|
struct ifnet* ifp = (struct ifnet*)data;
|
||||||
|
|
||||||
ifp->if_l2com = _kernel_malloc(sizeof(struct ieee80211com), M_ZERO);
|
ifp->if_l2com = _kernel_malloc(sizeof(struct ieee80211com), M_ZERO);
|
||||||
((struct ieee80211com*)(ifp->if_l2com))->ic_ifp = ifp;
|
|
||||||
if (ifp->if_l2com == NULL)
|
if (ifp->if_l2com == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
((struct ieee80211com*)(ifp->if_l2com))->ic_ifp = ifp;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user