Skip to content

Commit

Permalink
endpoint: release the current buffer as well, fixes #12
Browse files Browse the repository at this point in the history
As suggested by Frank Ebner (k-a-z-u).
  • Loading branch information
xqms committed Apr 11, 2015
1 parent ee240d1 commit 7326357
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions xtion-endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,13 @@ static void xtion_kill_urbs(struct xtion_endpoint *endp)
list_del(&buf->list);
vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
}
/* It's important to clear current buffer */
endp->active_buffer = 0;

/* The current buffer is not in the avail_bufs list, so release it
* separately. */
if (endp->active_buffer) {
vb2_buffer_done(&endp->active_buffer->vb, VB2_BUF_STATE_ERROR);
endp->active_buffer = 0;
}
spin_unlock_irqrestore(&endp->buf_lock, flags);
}

Expand Down

0 comments on commit 7326357

Please sign in to comment.