Commit 45f2ef65 authored by Mahavir Jain's avatar Mahavir Jain Committed by Anas Nashif
Browse files

work_q: delayed work cancel returns incorrect status



If delayed work is already submitted or completed, then subsequent
cancel should return -EINVAL as return status.

Fixes ZEP-1373.

Change-Id: I16bbacca7e31a5a5d8e5a89e729d70302ada6223
Signed-off-by: default avatarMahavir Jain <mjain@marvell.com>
parent 96c4a4b3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -71,6 +71,8 @@ static void work_timeout(struct _timeout *t)

	/* submit work to workqueue */
	k_work_submit_to_queue(w->work_q, &w->work);
	/* detach from workqueue, for cancel to return appropriate status */
	w->work_q = NULL;
}

void k_delayed_work_init(struct k_delayed_work *work, k_work_handler_t handler)