Skip to content

Commit f846823

Browse files
Coverity reported error fixes: (ARMmbed#1822)
CIDs fixed: 276776, 276777, and 276778
1 parent 708e8d3 commit f846823

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

source/6LoWPAN/Thread/thread_commissioning_api.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static int thread_commissioning_active_get_cb(int8_t service_id, uint8_t source_
257257

258258
tr_debug("management get response from comm module");
259259
if (!this) {
260-
goto notify_user;
260+
return -2;
261261
}
262262

263263
if ((len = thread_meshcop_tlv_find(response_ptr->payload_ptr, response_ptr->payload_len, MESHCOP_TLV_NETWORK_MESH_LOCAL_ULA, &ptr)) > 0) {
@@ -268,7 +268,6 @@ static int thread_commissioning_active_get_cb(int8_t service_id, uint8_t source_
268268
common_write_16_bit(0xfc00, this->leader_address + 14);
269269
}
270270

271-
notify_user:
272271
if (this->status_cb_ptr) {
273272
this->status_cb_ptr(this->interface_id, this->session_id, state);
274273
}
@@ -280,7 +279,7 @@ static int commissioning_leader_petition_recv_cb(int8_t service_id, uint8_t sour
280279
commissioner_t *this = commissioner_find_by_service(service_id);
281280
commissioning_state_e state = COMMISSIONING_STATE_REJECT;
282281
uint16_t session_id = 0;
283-
uint8_t *ptr;
282+
uint8_t *ptr = NULL;
284283
char *uri_ptr = THREAD_URI_ACTIVE_GET;
285284
(void) source_address;
286285
(void) source_port;

source/6LoWPAN/Thread/thread_management_api.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,10 @@ int thread_management_register(int8_t interface_id)
285285
this->interface_id = interface_id;
286286
this->set_response_cb_ptr = NULL;
287287
this->get_response_cb_ptr = NULL;
288-
thread_management_get_remote_addr(this);
288+
289+
if (thread_management_get_remote_addr(this)) {
290+
return -1;
291+
}
289292

290293
ns_list_add_to_start(&instance_list, this);
291294
if(this->native_interface) {

0 commit comments

Comments
 (0)