Skip to content

Commit

Permalink
9p: potential NULL dereference
Browse files Browse the repository at this point in the history
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: 996d5b4 ("9p: Use a slab for allocating requests")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Dominique Martinet <[email protected]>
  • Loading branch information
Dan Carpenter authored and Dominique Martinet committed Oct 10, 2018
1 parent b4dc44b commit 72ea032
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/9p/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 72ea032

Please sign in to comment.