freebsd_network: Remove unneeded frees of if_l2com.

After 458c40fb27, if_l2com is not
allocated anymore, but I missed deleting these at that time.
This commit is contained in:
Augustin Cavalier
2022-06-09 18:55:17 -04:00
parent 9690b012b4
commit 3c5b619e97
+1 -13
View File
@@ -175,7 +175,7 @@ if_alloc_inplace(struct ifnet *ifp, u_char type)
if (ifindex_alloc_locked(&index) != ENOERR) {
IFNET_WUNLOCK();
panic("too many devices");
goto err3;
goto err2;
}
ifnet_setbyindex_locked(index, IFNET_HOLD);
IFNET_WUNLOCK();
@@ -186,13 +186,6 @@ if_alloc_inplace(struct ifnet *ifp, u_char type)
IF_ADDR_LOCK_INIT(ifp);
return 0;
err3:
switch (type) {
case IFT_ETHER:
_kernel_free(ifp->if_l2com);
break;
}
err2:
delete_sem(ifp->receive_sem);
@@ -229,11 +222,6 @@ if_free_inplace(struct ifnet *ifp)
IFNET_WUNLOCK();
IF_ADDR_LOCK_DESTROY(ifp);
switch (ifp->if_type) {
case IFT_ETHER:
_kernel_free(ifp->if_l2com);
break;
}
delete_sem(ifp->receive_sem);
ifq_uninit(&ifp->receive_queue);