]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
iflib: remove kobject class reference increment
authorEric Joyner <erj@FreeBSD.org>
Thu, 1 Aug 2019 17:28:36 +0000 (17:28 +0000)
committerEric Joyner <erj@FreeBSD.org>
Thu, 1 Aug 2019 17:28:36 +0000 (17:28 +0000)
commit6a3f243b040ae041d6bba8a0c73a3c8c07169a42
treee5a3ec01697e8ba8ddcf845d1feddb003206e93f
parenta5ada504b340e3e85bf907cbdbb7109ee16edb70
iflib: remove kobject class reference increment

Commit message from Jake:
In iflib_register, the context is initialized as a kobject using the
device driver's "driver" kobject class. As part of this, the function
mistakenly increments the ref counter.

The ref counter is incremented twice, once in the code directly, and
once again by kobj_class_compile. However, there is no associated
decrement in the detach path. Because of this, the ref counter will
never go back down to zero, and thus the kobject method table will never
be released.

Remove this unnecessary reference count increment.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: jhb@, erj@
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D21125
sys/net/iflib.c