Skip to content

Commit

Permalink
net: qrtr: Fix error pointer vs NULL bugs
Browse files Browse the repository at this point in the history
The callers only expect NULL pointers, so returning an error pointer
will lead to an Oops.

Fixes: 0c2204a ("net: qrtr: Migrate nameservice to kernel from userspace")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Dan Carpenter authored and davem330 committed Feb 27, 2020
1 parent 1ac7b09 commit 9baeea5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/qrtr/ns.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static struct qrtr_node *node_get(unsigned int node_id)
/* If node didn't exist, allocate and insert it to the tree */
node = kzalloc(sizeof(*node), GFP_KERNEL);
if (!node)
return ERR_PTR(-ENOMEM);
return NULL;

node->id = node_id;

Expand Down Expand Up @@ -224,7 +224,7 @@ static struct qrtr_server *server_add(unsigned int service,

srv = kzalloc(sizeof(*srv), GFP_KERNEL);
if (!srv)
return ERR_PTR(-ENOMEM);
return NULL;

srv->service = service;
srv->instance = instance;
Expand Down

0 comments on commit 9baeea5

Please sign in to comment.