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:
parent
dfb55e5353
commit
22b5a03321
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue