lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:	Thu, 11 Feb 2010 11:20:45 +0300
From:	Dan Carpenter <error27@...il.com>
To:	netdev@...r.kernel.org
Cc:	Eric Van Hensbergen <ericvh@...il.com>,
	Abhishek Kulkarni <adkulkar@...il.iu.edu>,
	Venkateswararao Jujjuri <jvrao@...ibm.com>,
	Latchesar Ionkov <lucho@...kov.net>,
	"David S. Miller" <davem@...emloft.net>,
	kernel-janitors@...r.kernel.org
Subject: [patch] 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 <error27@...il.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;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ