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
Unknown Object (File)
Sat, Mar 30, 11:45 AM
Unknown Object (File)
Feb 20 2024, 9:19 AM
Unknown Object (File)
Dec 23 2023, 8:40 AM
Unknown Object (File)
Dec 10 2023, 7:21 PM
Unknown Object (File)
Nov 24 2023, 1:50 AM
Unknown Object (File)
Nov 15 2023, 12:26 PM
Unknown Object (File)
Oct 11 2023, 6:20 PM
Unknown Object (File)
Oct 2 2023, 9:52 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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25621
Build 24217: arc lint + arc unit