diff options
author | 2020-02-26 17:51:53 +0300 | |
---|---|---|
committer | 2020-02-26 20:52:31 -0800 | |
commit | 9baeea50718fdd55c7ae4d61c15f2a71aef6e050 (patch) | |
tree | 24c6cd55f8bac77983c362c20114fb88a5027e03 /net | |
parent | net: phy: mscc: add missing shift for media operation mode selection (diff) | |
download | linux-9baeea50718fdd55c7ae4d61c15f2a71aef6e050.tar.gz linux-9baeea50718fdd55c7ae4d61c15f2a71aef6e050.tar.bz2 linux-9baeea50718fdd55c7ae4d61c15f2a71aef6e050.zip |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/qrtr/ns.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/qrtr/ns.c b/net/qrtr/ns.c index 7bfde01f4e8a..413228c4520e 100644 --- a/net/qrtr/ns.c +++ b/net/qrtr/ns.c @@ -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; |