Skip to content
Commit 7c7a9bcc authored by Roland Dreier's avatar Roland Dreier
Browse files

IB/cm: Fix infiniband_cm class kobject ref counting

Commit 9af57b7a

 ("IB/cm: Add basic performance counters") introduced a
bug in how the reference count for cm_class.subsys.kobj was handled:
the path that released a device did a kobject_put() on that kobject, but
there was no kobject_get() in the path the handles adding a device.  So
the reference count ended up too low, which leads to bad things.  Fix up
and simplify the reference counting to avoid this.

(Actually, I introduced the bug when fixing the patch up to match some
of Greg's kobject changes, but who's counting)

Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent ab64b960
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment