Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72ea0321 authored by Dan Carpenter's avatar Dan Carpenter Committed by Dominique Martinet
Browse files

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: 996d5b4d ("9p: Use a slab for allocating requests")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDominique Martinet <dominique.martinet@cea.fr>
parent b4dc44b3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;