drivers: clock_control_nrf2: Add missing cancelation of request
This is a follow-up to commit fe0e2dbc. 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 successfully a bit later, but the caller will not be aware that the clock needs to be released (since the call resulted in an error). And actually even more serious problem is that because the `req` structure is placed on stack, after the function returns, the contents of this structure will be probably overwritten with some other data, so if the request finishes at that point, an attempt to execute the callback function pointed by this structure will most likely cause a crash. Signed-off-by:Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Loading
Please sign in to comment