diff options
author | Sergey Senozhatsky <senozhatsky@chromium.org> | 2021-09-28 05:46:34 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-10-19 09:08:38 +0200 |
commit | 67f85135c57c8ea20b5417b28ae65e53dc2ec2c3 (patch) | |
tree | f51cd5a3d4d10f5aeaae7e64b6a43fbc0c5a966e /drivers/media | |
parent | media: rcar-vin: add G/S_PARM ioctls (diff) | |
download | linux-67f85135c57c8ea20b5417b28ae65e53dc2ec2c3.tar.xz linux-67f85135c57c8ea20b5417b28ae65e53dc2ec2c3.zip |
media: videobuf2: always set buffer vb2 pointer
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>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/common/videobuf2/videobuf2-dma-contig.c | 3 |
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 b052a4e36961..38767791955d 100644 --- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c +++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c @@ -600,6 +600,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); @@ -788,6 +789,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)) { |