[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180926103934.GA14535@mwanda>
Date: Wed, 26 Sep 2018 13:39:34 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Eric Van Hensbergen <ericvh@...il.com>,
Matthew Wilcox <willy@...radead.org>
Cc: Latchesar Ionkov <lucho@...kov.net>,
Dominique Martinet <asmadeus@...ewreck.org>,
"David S. Miller" <davem@...emloft.net>,
v9fs-developer@...ts.sourceforge.net, netdev@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH] 9p: potential NULL dereference
p9_tag_alloc() is supposed to return error pointers, but we accidentally
return a NULL here. It would cause a NULL dereference in the caller.
Fixes: 996d5b4db4b1 ("9p: Use a slab for allocating requests")
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
diff --git a/net/9p/client.c b/net/9p/client.c
index 47fa6158a75a..5f23e18eecc0 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -281,7 +281,7 @@ p9_tag_alloc(struct p9_client *c, int8_t type, unsigned int max_size)
int tag;
if (!req)
- return NULL;
+ return ERR_PTR(-ENOMEM);
if (p9_fcall_init(c, &req->tc, alloc_msize))
goto free_req;
Powered by blists - more mailing lists