diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 47bdc07f1c91..c513bd719f96 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1335,9 +1335,9 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCGIFMEDIA: VLAN_LOCK(); if (TRUNK(ifv) != NULL) { - error = (*PARENT(ifv)->if_ioctl)(PARENT(ifv), - SIOCGIFMEDIA, data); + p = PARENT(ifv); VLAN_UNLOCK(); + error = (*p->if_ioctl)(p, SIOCGIFMEDIA, data); /* Limit the result to the parent's current config. */ if (error == 0) { struct ifmediareq *ifmr;