diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c index 04f2658712dab2eb857a6cd734aa52eab04c98e0..4dcf3bff4c8fabd0780dc223c15ae1802785b863 100644 --- a/drivers/misc/uacce/uacce.c +++ b/drivers/misc/uacce/uacce.c @@ -47,10 +47,13 @@ static int uacce_stop_queue(struct uacce_queue *q) { struct uacce_device *uacce = q->uacce; - if ((q->state == UACCE_Q_STARTED) && uacce->ops->stop_queue) + if (q->state != UACCE_Q_STARTED) + return 0; + + if (uacce->ops->stop_queue) uacce->ops->stop_queue(q); - q->state = UACCE_Q_ZOMBIE; + q->state = UACCE_Q_INIT; return 0; } @@ -61,8 +64,13 @@ static void uacce_put_queue(struct uacce_queue *q) uacce_stop_queue(q); + if (q->state != UACCE_Q_INIT) + return; + if (uacce->ops->put_queue) uacce->ops->put_queue(q); + + q->state = UACCE_Q_ZOMBIE; } static long uacce_get_ss_dma(struct uacce_queue *q, void __user *arg)