Commit 22b5a033 authored by Yong Cong Sin's avatar Yong Cong Sin Committed by Christopher Friedt
Browse files

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: default avatarYong Cong Sin <yongcong.sin@gmail.com>
parent dfb55e53
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;
			}
		}