Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 453c6587 authored by Dan Carpenter's avatar Dan Carpenter Committed by Chris Lew
Browse files

net: qrtr: Fix error pointer vs NULL bugs



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

Change-Id: I7212bbd4890bbfc391b900845fa380ea484f01d7
Fixes: 0c2204a4ad71 ("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>
Git-commit: 9baeea50718fdd55c7ae4d61c15f2a71aef6e050
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarChris Lew <clew@codeaurora.org>
parent afc0e1fe
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;