From: Dan Carpenter <error27@gmail.com>
To: netdev@vger.kernel.org
Cc: Eric Van Hensbergen <ericvh@gmail.com>,
Abhishek Kulkarni <adkulkar@umail.iu.edu>,
Venkateswararao Jujjuri <jvrao@us.ibm.com>,
Latchesar Ionkov <lucho@ionkov.net>,
"David S. Miller" <davem@davemloft.net>,
kernel-janitors@vger.kernel.org
Subject: [patch] 9p: fix return value of rdma_request()
Date: Thu, 11 Feb 2010 11:20:45 +0300 [thread overview]
Message-ID: <20100211082044.GE14210@bicker> (raw)
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;
reply other threads:[~2010-02-11 8:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100211082044.GE14210@bicker \
--to=error27@gmail.com \
--cc=adkulkar@umail.iu.edu \
--cc=davem@davemloft.net \
--cc=ericvh@gmail.com \
--cc=jvrao@us.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lucho@ionkov.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).