Skip to content

Commit

Permalink
resource: ubridge: fix device reserved state change during 'exit' sca…
Browse files Browse the repository at this point in the history
…n phase
  • Loading branch information
prajnoha committed Jan 26, 2024
1 parent b82a448 commit 1fe8dc2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/resource/ubridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -4543,14 +4543,17 @@ static int _cmd_exec_scan_wait(sid_resource_t *cmd_res)
static int _cmd_exec_scan_exit(sid_resource_t *cmd_res)
{
struct sid_ucmd_ctx *ucmd_ctx = sid_resource_get_data(cmd_res);
int r = 0;

if (_do_sid_ucmd_dev_get_ready(NULL, ucmd_ctx, 0) == DEV_RDY_UNPROCESSED)
return _do_sid_ucmd_dev_set_ready(cmd_res, ucmd_ctx, DEV_RDY_PUBLIC);
if (_do_sid_ucmd_dev_set_ready(cmd_res, ucmd_ctx, DEV_RDY_PUBLIC) < 0)
r = -1;

if (_do_sid_ucmd_dev_get_reserved(NULL, ucmd_ctx, 0) == DEV_RES_UNPROCESSED)
return _do_sid_ucmd_dev_set_reserved(cmd_res, ucmd_ctx, DEV_RES_FREE);
if (_do_sid_ucmd_dev_set_reserved(cmd_res, ucmd_ctx, DEV_RES_FREE) < 0)
r = -1;

return 0;
return r;
}

static int _cmd_exec_scan_cleanup(sid_resource_t *cmd_res)
Expand Down

0 comments on commit 1fe8dc2

Please sign in to comment.