Page MenuHomeFreeBSD

iflib: remove kobject class reference increment
ClosedPublic

Authored by jacob.e.keller_intel.com on Jul 31 2019, 7:48 PM.
Tags
None
Referenced Files
F106067001: D21125.diff
Tue, Dec 24, 8:16 PM
Unknown Object (File)
Sun, Dec 22, 7:32 PM
Unknown Object (File)
Mon, Dec 9, 7:21 AM
Unknown Object (File)
Nov 20 2024, 9:04 AM
Unknown Object (File)
Nov 5 2024, 9:11 PM
Unknown Object (File)
Oct 18 2024, 9:29 AM
Unknown Object (File)
Oct 3 2024, 4:52 PM
Unknown Object (File)
Oct 2 2024, 5:05 PM
Subscribers

Details

Summary

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>

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable