IB/cxgb3: Fix error codes in iwch_alloc_mr()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 13 Jul 2017 07:48:00 +0000 (10:48 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 11 Nov 2017 13:34:25 +0000 (13:34 +0000)
commit16ebb03ba24c5241025a86aa6f2cd60f9667e849
treeb5b94ad8f2a839f52c63c1ad7d312fa3d269f379
parentce56b921aade5f233c3814c5ff28461133117078
IB/cxgb3: Fix error codes in iwch_alloc_mr()

commit 9064d6055c14f700aa13f7c72fd3e63d12bee643 upstream.

We accidentally don't set the error code on some error paths.  It means
return ERR_PTR(0) which is NULL and results in a NULL dereference in the
caller.

Fixes: 13a239330abd ("RDMA/cxgb3: Don't ignore insert_handle() failures")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
[bwh: Backported to 3.2: drop inapplicable hunk]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/infiniband/hw/cxgb3/iwch_provider.c