summaryrefslogtreecommitdiff
path: root/payloads/libpayload/drivers/udc/chipidea.c
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload/drivers/udc/chipidea.c')
-rw-r--r--payloads/libpayload/drivers/udc/chipidea.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/payloads/libpayload/drivers/udc/chipidea.c b/payloads/libpayload/drivers/udc/chipidea.c
index 58bea063e7..850d0c05b9 100644
--- a/payloads/libpayload/drivers/udc/chipidea.c
+++ b/payloads/libpayload/drivers/udc/chipidea.c
@@ -138,6 +138,14 @@ static void chipidea_halt_ep(struct usbdev_ctrl *this, int ep, int in_dir)
while (readl(&p->opreg->epflush))
;
clrbits_le32(&p->opreg->epctrl[ep], 1 << (7 + (in_dir ? 16 : 0)));
+
+ while (!SIMPLEQ_EMPTY(&p->job_queue[ep][in_dir])) {
+ struct job *job = SIMPLEQ_FIRST(&p->job_queue[ep][in_dir]);
+ if (job->autofree)
+ free(job->data);
+
+ SIMPLEQ_REMOVE_HEAD(&p->job_queue[ep][in_dir], queue);
+ }
}
static void chipidea_start_ep(struct usbdev_ctrl *this,