nvlsianpu commented on a change in pull request #104:
URL: https://github.com/apache/mynewt-mcumgr/pull/104#discussion_r542338231



##########
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_DIRECT_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_EUNKNOWN;

Review comment:
       MGMT_ERR_EINVAL




----------------------------------------------------------------
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]


Reply via email to