Skip to content

Commit c87958c

Browse files
ananglnordicjm
authored andcommitted
[nrf fromlist] drivers: clock_control_nrf2: Add missing cancelation of 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]>
1 parent 3ac5893 commit c87958c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/clock_control/clock_control_nrf2_common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ int nrf_clock_control_request_sync(const struct device *dev,
198198

199199
err = k_sem_take(&req.sem, timeout);
200200
if (err < 0) {
201+
nrf_clock_control_cancel_or_release(dev, spec, &req.cli);
201202
return err;
202203
}
203204

0 commit comments

Comments
 (0)