Release the planes from num_planes - 1 to 0. Signed-off-by: Yunke Cao <yunkec@xxxxxxxxxxxx> --- drivers/media/common/videobuf2/videobuf2-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index 702f7b6f783a..a5368cef73bb 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -320,10 +320,10 @@ static void __vb2_plane_dmabuf_put(struct vb2_buffer *vb, struct vb2_plane *p) */ static void __vb2_buf_dmabuf_put(struct vb2_buffer *vb) { - unsigned int plane; + unsigned int i; - for (plane = 0; plane < vb->num_planes; ++plane) - __vb2_plane_dmabuf_put(vb, &vb->planes[plane]); + for (i = 0; i < vb->num_planes; ++i) + __vb2_plane_dmabuf_put(vb, &vb->planes[vb->num_planes - 1 - i]); } /* -- 2.44.0.478.gd926399ef9-goog