]> git.baikalelectronics.ru Git - kernel.git/commit
IB/cm: Fix infiniband_cm class kobject ref counting
authorRoland Dreier <rolandd@cisco.com>
Tue, 12 Feb 2008 22:38:27 +0000 (14:38 -0800)
committerRoland Dreier <rolandd@cisco.com>
Tue, 12 Feb 2008 22:38:27 +0000 (14:38 -0800)
commita864af37723e77a4898b53dff79b3c76c4aea5cb
tree97a8a5e88339a5defa770c19466190b8a20c0943
parent52a85e3545966843591d9199817ad838e5cb9653
IB/cm: Fix infiniband_cm class kobject ref counting

Commit e708d6a4 ("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: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/core/cm.c