From: Roland Dreier Date: Thu, 22 Feb 2007 21:16:51 +0000 (-0800) Subject: IB/uverbs: Return correct error for invalid PD in register MR X-Git-Tag: v2.6.21-rc2~29^2~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aaf1aef55f50f53812871693692c7cbefcd57f39;p=pandora-kernel.git 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 --- Reading git-diff-tree failed