net: lwm2m: break the opaque write loop early when fail

As title, check the return value from the write callback and break if
an error is returned

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
This commit is contained in:
Robert Chou 2017-11-01 14:36:50 +08:00 committed by Jukka Rissanen
commit a37f049e6d

View file

@ -1903,6 +1903,9 @@ static int lwm2m_write_handler_opaque(struct lwm2m_engine_obj_inst *obj_inst,
data_ptr, len, data_ptr, len,
last_pkt_block && last_block, last_pkt_block && last_block,
total_size); total_size);
if (ret < 0) {
return ret;
}
} }
} }