When a buffer is returned to state QUEUED (that happens when
start_streaming fails), then do not unbind and put the object
from the request. Nothing has changed yet, so just keep it as
is.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
        }
        atomic_dec(&q->owned_by_drv_count);
 
-       if (vb->req_obj.req) {
+       if (state != VB2_BUF_STATE_QUEUED && vb->req_obj.req) {
                /* This is not supported at the moment */
                WARN_ON(state == VB2_BUF_STATE_REQUEUEING);
                media_request_object_unbind(&vb->req_obj);