9p: fix return value of rdma_request()
Subsystems (4)
PATCH 1/1 9p: fix return value of rdma_request()
rdma_request() is supposed to return negative values on error. This change means that if a kmalloc() fails it returns -ENOMEM. The original code returned certain negative values, zero on success and zero on kmalloc() failures.
Signed-off-by Dan Carpenter <[email protected]>
---
I was just reading the code and I noticed this bug. I haven't tested it because I don't have the hardware.
net/9p/trans_rdma.c +1 -1
@@ -419,7 +419,7 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req)struct p9_trans_rdma *rdma = client->trans;struct ib_send_wr wr, *bad_wr;struct ib_sge sge; -int err =0 ; +int err = -ENOMEM ;unsigned long flags;struct p9_rdma_context *c =NULL ;struct p9_rdma_context *rpl_context =NULL ;