]> git.baikalelectronics.ru Git - kernel.git/commit
IB/uverbs: Return correct error for invalid PD in register MR
authorRoland Dreier <rolandd@cisco.com>
Thu, 22 Feb 2007 21:16:51 +0000 (13:16 -0800)
committerRoland Dreier <rolandd@cisco.com>
Thu, 22 Feb 2007 21:16:51 +0000 (13:16 -0800)
commitb296118908bda97dfeeaf61e58be6e95b251252d
tree01a533c2f93dccda7176ce4bf3d68c3212a8c0b4
parent8033e52517ac9116067886f3194eac6f93048088
IB/uverbs: Return correct error for invalid PD in register MR

If no matching PD is found in ib_uverbs_reg_mr(), then the function
jumps to err_release without setting the return value ret.  This means
that ret will hold the return value of the call to ib_umem_get() a few
lines earlier; if the function reaches the point where it looks for
the PD, we know that ib_umem_get() must have returned 0, so
ib_uverbs_reg_mr() ends up return 0 for a bad PD ID.  Fix this by
setting ret to -EINVAL before jumping to the exit path when no PD is
found.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/core/uverbs_cmd.c