summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Senozhatsky <senozhatsky@chromium.org>2021-09-28 04:46:34 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-17 11:04:52 +0100
commit283fd7d9fdea4652f8922404ea152e651a3ac44b (patch)
tree94bf46fe32a61f205c562e116be3c951fb891cf4
parent6a1968a2f2f6f8555526fccb19530721b5cbc444 (diff)
downloadlinux-rt-283fd7d9fdea4652f8922404ea152e651a3ac44b.tar.gz
media: videobuf2: always set buffer vb2 pointer
commit 67f85135c57c8ea20b5417b28ae65e53dc2ec2c3 upstream. We need to always link allocated vb2_dc_buf back to vb2_buffer because we dereference vb2 in prepare() and finish() callbacks. Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org> Tested-by: Chen-Yu Tsai <wenst@chromium.org> Acked-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/media/common/videobuf2/videobuf2-dma-contig.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
index 019c3843dc6d..be376f3011b6 100644
--- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c
+++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
@@ -497,6 +497,7 @@ static void *vb2_dc_get_userptr(struct vb2_buffer *vb, struct device *dev,
buf->dev = dev;
buf->dma_dir = vb->vb2_queue->dma_dir;
+ buf->vb = vb;
offset = lower_32_bits(offset_in_page(vaddr));
vec = vb2_create_framevec(vaddr, size);
@@ -683,6 +684,8 @@ static void *vb2_dc_attach_dmabuf(struct vb2_buffer *vb, struct device *dev,
return ERR_PTR(-ENOMEM);
buf->dev = dev;
+ buf->vb = vb;
+
/* create attachment for the dmabuf with the user device */
dba = dma_buf_attach(dbuf, buf->dev);
if (IS_ERR(dba)) {