IB/qib: Fix refcount leak in lkey/rkey validation
authorMike Marciniszyn <mike.marciniszyn@qlogic.org>
Tue, 11 Jan 2011 01:42:23 +0000 (17:42 -0800)
committerRoland Dreier <rolandd@cisco.com>
Tue, 11 Jan 2011 01:42:23 +0000 (17:42 -0800)
commit4db62d4786e946e6fc8c2bb1f9201508f7f46c41
treedbd1bf62fa05e53d225f54d24e6db28eab7bb6cc
parentf2d255a0787119f7f4dc0e6093a0bd2700a49402
IB/qib: Fix refcount leak in lkey/rkey validation

The mr optimization introduced a reference count leak on an exception
test.  The lock/refcount manipulation is moved down and the problematic
exception test now calls bail to insure that the lock is released.

Additional fixes as suggested by Ralph Campbell <ralph.campbell@qlogic.org>:
- reduce lock scope of dma regions
- use explicit values on returns vs. automatic ret value

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/qib/qib_keys.c