Skip to content

Commit d3330b2

Browse files
author
Arto Kinnunen
authored
Fix errors found by Coverity (#2131)
-349324 Dereference null return value -349290 Dereference after null check
1 parent da5d2c7 commit d3330b2

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -664,10 +664,7 @@ uint16_t ws_etx_read(protocol_interface_info_entry_t *interface, addrtype_t addr
664664
if (!ws_neighbour || !etx_entry || etx_entry->etx_samples < 1 /*||
665665
!ws_neighbour->candidate_parent*/) {
666666
// if RSL value is not good enough candidate parent flag is removed and device not accepted as parent
667-
//tr_debug("ws_etx_read not valid parent");
668-
if (etx_entry && etx_entry->etx_samples) {
669-
tr_debug("ws_etx_read not valid %u RSL IN(%u), %u RSL out(%u)", ws_neighbor_class_rsl_in_get(ws_neighbour), ws_neighbour->rsl_in, ws_neighbor_class_rsl_out_get(ws_neighbour), ws_neighbour->rsl_out);
670-
}
667+
tr_debug("ws_etx_read not valid params");
671668
return 0xffff;
672669
}
673670

source/6LoWPAN/ws/ws_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ void ws_common_etx_validate(protocol_interface_info_entry_t *interface, mac_neig
415415
{
416416
etx_storage_t *etx_entry = etx_storage_entry_get(interface->id, neigh->index);
417417

418-
if (neigh->nud_active || !neigh->trusted_device || etx_entry->etx_samples) {
418+
if (neigh->nud_active || !neigh->trusted_device || !etx_entry || etx_entry->etx_samples) {
419419
return; //Do not trig Second NS if Active NUD already, not trusted or ETX samples already done
420420
}
421421

0 commit comments

Comments
 (0)