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: 0c2204a4ad
("net: qrtr: Migrate nameservice to kernel from userspace")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1ac7b090ec
commit
9baeea5071
|
@ -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 */
|
/* If node didn't exist, allocate and insert it to the tree */
|
||||||
node = kzalloc(sizeof(*node), GFP_KERNEL);
|
node = kzalloc(sizeof(*node), GFP_KERNEL);
|
||||||
if (!node)
|
if (!node)
|
||||||
return ERR_PTR(-ENOMEM);
|
return NULL;
|
||||||
|
|
||||||
node->id = node_id;
|
node->id = node_id;
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ static struct qrtr_server *server_add(unsigned int service,
|
||||||
|
|
||||||
srv = kzalloc(sizeof(*srv), GFP_KERNEL);
|
srv = kzalloc(sizeof(*srv), GFP_KERNEL);
|
||||||
if (!srv)
|
if (!srv)
|
||||||
return ERR_PTR(-ENOMEM);
|
return NULL;
|
||||||
|
|
||||||
srv->service = service;
|
srv->service = service;
|
||||||
srv->instance = instance;
|
srv->instance = instance;
|
||||||
|
|
Loading…
Reference in a new issue