summaryrefslogtreecommitdiff
path: root/mesh/appkey.c
diff options
context:
space:
mode:
authorInga Stotland <inga.stotland@intel.com>2020-11-05 23:10:53 -0800
committerBrian Gix <brian.gix@intel.com>2020-11-10 10:24:11 -0800
commitdac8ef3b0a54708f34293e87c261a9e4f6630e0e (patch)
treec0113b17e86391bc694ec187cb99765ae4777f2b /mesh/appkey.c
parent02e46e9df6b0d897e6ba67dc3ea18e5e9c510e44 (diff)
downloadbluez-dac8ef3b0a54708f34293e87c261a9e4f6630e0e.tar.gz
mesh: Fix errors found by static analysis
This fixes a NULL pointer dereference error (cfgmod-server.c) and miscellaneous issues related to unchecked return status.
Diffstat (limited to 'mesh/appkey.c')
-rw-r--r--mesh/appkey.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesh/appkey.c b/mesh/appkey.c
index 7efb8f5c4..549f5a80d 100644
--- a/mesh/appkey.c
+++ b/mesh/appkey.c
@@ -100,11 +100,11 @@ bool appkey_key_init(struct mesh_net *net, uint16_t net_idx, uint16_t app_idx,
if (!app_keys)
return NULL;
- key = app_key_new();
- if (!key)
+ if (!mesh_net_have_key(net, net_idx))
return false;
- if (!mesh_net_have_key(net, net_idx))
+ key = app_key_new();
+ if (!key)
return false;
key->net_idx = net_idx;