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.

Link: http://lkml.kernel.org/m/20180926103934.GA14535@mwanda
Fixes: 996d5b4db4 ("9p: Use a slab for allocating requests")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
This commit is contained in:
Dan Carpenter 2018-09-26 13:39:34 +03:00 committed by Dominique Martinet
parent b4dc44b3ca
commit 72ea032108

View File

@ -281,7 +281,7 @@ p9_tag_alloc(struct p9_client *c, int8_t type, unsigned int max_size)
int tag; int tag;
if (!req) if (!req)
return NULL; return ERR_PTR(-ENOMEM);
if (p9_fcall_init(c, &req->tc, alloc_msize)) if (p9_fcall_init(c, &req->tc, alloc_msize))
goto free_req; goto free_req;