Skip to content

Commit

Permalink
net: lwm2m: Fix pointless variable assignment
Browse files Browse the repository at this point in the history
Coverity reported that assigning ret = 0 is pointless, as in any
scenario (loop continues or ends) the ret variable is overwritten
anyway, w/o using the assigned value. Therefore remove the needless
assignment.

Signed-off-by: Robert Lubos <[email protected]>
  • Loading branch information
rlubos authored and nashif committed Jun 7, 2023
1 parent 4790361 commit e5aa433
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions subsys/net/lib/lwm2m/lwm2m_message_handling.c
Original file line number Diff line number Diff line change
Expand Up @@ -1661,9 +1661,6 @@ static int lwm2m_perform_read_object_instance(struct lwm2m_message *msg,
if (ret < 0 && msg->path.level > LWM2M_PATH_LEVEL_OBJECT_INST) {
break;
}

/* when reading multiple resources ignore return code */
ret = 0;
}

move_forward:
Expand Down

0 comments on commit e5aa433

Please sign in to comment.