Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 0c2204a4ad71 ("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>

authored by

Dan Carpenter and committed by
David S. Miller
9baeea50 1ac7b090

+2 -2
+2 -2
net/qrtr/ns.c
··· 76 76 /* If node didn't exist, allocate and insert it to the tree */ 77 77 node = kzalloc(sizeof(*node), GFP_KERNEL); 78 78 if (!node) 79 - return ERR_PTR(-ENOMEM); 79 + return NULL; 80 80 81 81 node->id = node_id; 82 82 ··· 224 224 225 225 srv = kzalloc(sizeof(*srv), GFP_KERNEL); 226 226 if (!srv) 227 - return ERR_PTR(-ENOMEM); 227 + return NULL; 228 228 229 229 srv->service = service; 230 230 srv->instance = instance;