Commit 9baeea50 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

net: qrtr: Fix error pointer vs NULL bugs

The callers only expect NULL pointers, so returning an error pointer
will lead to an Oops.

Fixes: 0c2204a4 ("net: qrtr: Migrate nameservice to kernel from userspace")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1ac7b090
......@@ -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;
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment