Skip to content

Commit

Permalink
[nrf fromlist] drivers: clock_control_nrf2: Add missing cancelation o…
Browse files Browse the repository at this point in the history
…f request

This is a follow-up to commit fe0e2db.

If `nrf_clock_control_request_sync()` ends up with a timeout, before
returning it must cancel the request that was not fulfilled on time.
Otherwise, the request may actually finish succesfully a bit later,
but the caller will not be aware that the clock needs to be released
(since the call resulted in an error).

Upstream PR #: 82994

Signed-off-by: Andrzej Głąbek <[email protected]>
  • Loading branch information
anangl authored and nordicjm committed Dec 16, 2024
1 parent 3ac5893 commit c87958c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/clock_control/clock_control_nrf2_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ int nrf_clock_control_request_sync(const struct device *dev,

err = k_sem_take(&req.sem, timeout);
if (err < 0) {
nrf_clock_control_cancel_or_release(dev, spec, &req.cli);
return err;
}

Expand Down

0 comments on commit c87958c

Please sign in to comment.