Skip to content

Commit

Permalink
applications: nrf_desktop: Fix returning error in MCUmgr callbacks
Browse files Browse the repository at this point in the history
Change fixes returning error in MCUmgr callbacks. This prevents
assertion failures when the error is returned by the application module.

Jira: NCSDK-22964

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
  • Loading branch information
MarekPieta committed Aug 4, 2023
1 parent 117a3ed commit 52652b7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions applications/nrf_desktop/src/modules/dfu_mcumgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ static enum mgmt_cb_return mcumgr_img_mgmt_cb(uint32_t event,
k_work_reschedule(&dfu_timeout, DFU_TIMEOUT);
if (IS_ENABLED(CONFIG_DESKTOP_DFU_LOCK) && dfu_lock_claim(&mcumgr_owner)) {
(void)k_work_cancel_delayable(&dfu_timeout);
return MGMT_ERR_EACCESSDENIED;
*rc = MGMT_ERR_EACCESSDENIED;
return MGMT_CB_ERROR_RC;
}

if (IS_ENABLED(CONFIG_MCUMGR_TRANSPORT_BT) &&
Expand All @@ -96,7 +97,8 @@ static enum mgmt_cb_return mcumgr_os_mgmt_reset_cb(uint32_t event,
k_work_reschedule(&dfu_timeout, DFU_TIMEOUT);
if (IS_ENABLED(CONFIG_DESKTOP_DFU_LOCK) && dfu_lock_claim(&mcumgr_owner)) {
(void)k_work_cancel_delayable(&dfu_timeout);
return MGMT_ERR_EACCESSDENIED;
*rc = MGMT_ERR_EACCESSDENIED;
return MGMT_CB_ERROR_RC;
}

return MGMT_CB_OK;
Expand Down

0 comments on commit 52652b7

Please sign in to comment.