media: vb2: set owner before calling vb2_read
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 1 Feb 2023 13:06:47 +0000 (14:06 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 19 Mar 2023 21:09:55 +0000 (22:09 +0100)
commit2f8c0810af739ec3587d00bf36cc5a6a0139be1a
treeea1b972a2c4fefc913fe6e5233efb5ef10739ae5
parent55f1ecb1199000932cf82e357841cc7498ac904f
media: vb2: set owner before calling vb2_read

Before vb2_read is called, the owner must be set since vb2_read will
actually start streaming. If vb2_read returns an error and q->fileio is
NULL, then it failed to start streaming and the owner is set back to NULL.

When the vb2 start_streaming callback is called, it expects the owner
pointer to be set, and that wasn't the case in this particular situation.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/common/videobuf2/videobuf2-v4l2.c