netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] 9p: fix return value of rdma_request()
@ 2010-02-11  8:20 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-02-11  8:20 UTC (permalink / raw)
  To: netdev
  Cc: Eric Van Hensbergen, Abhishek Kulkarni, Venkateswararao Jujjuri,
	Latchesar Ionkov, David S. Miller, kernel-janitors

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 <error27@gmail.com>
---
I was just reading the code and I noticed this bug.  I haven't tested it because I
don't have the hardware.

diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c
index 2c95a89..589e340 100644
--- a/net/9p/trans_rdma.c
+++ b/net/9p/trans_rdma.c
@@ -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;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-02-11  8:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-11  8:20 [patch] 9p: fix return value of rdma_request() Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).