]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
iflib: hold the CTX lock in iflib_pseudo_register
authorerj <erj@FreeBSD.org>
Thu, 28 Mar 2019 20:43:47 +0000 (20:43 +0000)
committererj <erj@FreeBSD.org>
Thu, 28 Mar 2019 20:43:47 +0000 (20:43 +0000)
commit3290e27ba6e547ca8b644442e049926fcae242ae
tree393f06e0cce3708c37d88674f9bdb4721f4b7887
parent4ef45ba40d370005ccef60735b3c1b9fa3a67a9d
iflib: hold the CTX lock in iflib_pseudo_register

From Jake:
The iflib_device_register function takes the CTX lock before calling
IFDI_ATTACH_PRE, and releases it upon finishing the registration.

Mirror this process in iflib_pseudo_register, so that we always hold the
CTX lock during the attach process when registering a pseudo interface
or a regular interface.

This was caught by code inspection while attempting to analyze where the
CTX lock was held.

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: shurd@, erj@
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D19604
sys/net/iflib.c