kernel: work_q: fix return value in non-error case
A recent patch allowed an error code to be returned even though the execution path treated it as a non-error condition. Clear the code before returning. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
f64cd1a5db
commit
d8146d6c6d
1 changed files with 3 additions and 1 deletions
|
@ -99,7 +99,9 @@ int k_delayed_work_submit_to_queue(struct k_work_q *work_q,
|
||||||
/* -EALREADY indicates the work has already completed so this
|
/* -EALREADY indicates the work has already completed so this
|
||||||
* is likely a recurring work.
|
* is likely a recurring work.
|
||||||
*/
|
*/
|
||||||
if (err < 0 && err != -EALREADY) {
|
if (err == -EALREADY) {
|
||||||
|
err = 0;
|
||||||
|
} else if (err < 0) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue