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)
Mon, Feb 24, 5:29 PM
Unknown Object (File)
Sat, Feb 15, 9:37 AM
Unknown Object (File)
Sat, Feb 8, 7:57 AM
Unknown Object (File)
Jan 24 2025, 5:53 PM
Unknown Object (File)
Jan 15 2025, 11:42 PM
Unknown Object (File)
Jan 15 2025, 6:58 PM
Unknown Object (File)
Jan 12 2025, 2:15 PM
Unknown Object (File)
Jan 8 2025, 8:01 AM
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