subsys/mgmt/hawkbit: Break and return if error

There's no need to continue if there's an error, so just break and
return.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This commit is contained in:
Yong Cong Sin 2021-08-31 16:34:12 +08:00 committed by Christopher Friedt
commit 22b5a03321

View file

@ -735,6 +735,7 @@ static void response_cb(struct http_response *rsp,
hb_context.dl.http_content_size,
hb_context.dl.downloaded_size);
hb_context.code_status = HAWKBIT_METADATA_ERROR;
break;
}
hb_context.response_data[hb_context.dl.downloaded_size] = '\0';
@ -807,6 +808,7 @@ static void response_cb(struct http_response *rsp,
if (hb_context.dl.http_content_size != hb_context.dl.downloaded_size) {
LOG_ERR("HTTP response len mismatch");
hb_context.code_status = HAWKBIT_METADATA_ERROR;
break;
}
hb_context.response_data[hb_context.dl.downloaded_size] = '\0';
@ -855,6 +857,7 @@ static void response_cb(struct http_response *rsp,
if (ret < 0) {
LOG_ERR("Flash write error: %d", ret);
hb_context.code_status = HAWKBIT_DOWNLOAD_ERROR;
break;
}
}