Skip to content

Commit 6e6c816

Browse files
jfischer-nokartben
authored andcommitted
usb: device_next: lock scheduler in usbd_enable()
Lock the scheduler until the device is fully enabled, similar to usbd_init(); Signed-off-by: Johann Fischer <[email protected]>
1 parent 92dd07e commit 6e6c816

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

subsys/usb/device_next/usbd_device.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ int usbd_enable(struct usbd_context *const uds_ctx)
249249
{
250250
int ret;
251251

252+
k_sched_lock();
252253
usbd_device_lock(uds_ctx);
253254

254255
if (!usbd_is_initialized(uds_ctx)) {
@@ -279,6 +280,8 @@ int usbd_enable(struct usbd_context *const uds_ctx)
279280

280281
enable_exit:
281282
usbd_device_unlock(uds_ctx);
283+
k_sched_unlock();
284+
282285
return ret;
283286
}
284287

0 commit comments

Comments
 (0)