utzig commented on a change in pull request #104:
URL: https://github.com/apache/mynewt-mcumgr/pull/104#discussion_r542926899
##########
File path: cmd/img_mgmt/port/zephyr/src/zephyr_img_mgmt.c
##########
@@ -495,6 +495,25 @@ img_mgmt_impl_upload_inspect(const struct
img_mgmt_upload_req *req,
return MGMT_ERR_ENOMEM;
}
+
+#if defined(CONFIG_IMG_MGMT_REJECT_DIRECT_XIP_MISMATCHED_SLOT)
+ if (hdr->ih_flags & IMAGE_F_ROM_FIXED_ADDR) {
+ rc = flash_area_open(action->area_id, &fa);
+ if (rc) {
+ *errstr = img_mgmt_err_str_flash_open_failed;
+ return MGMT_ERR_EUNKNOWN;
+ }
+
+ if (fa->fa_off != hdr->ih_load_addr) {
+ *errstr = img_mgmt_err_str_image_bad_flash_addr;
+ return MGMT_ERR_EINVAL;
Review comment:
This path leaves the flash area open.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]