media: videobuf-core.c: poll_wait needs a non-NULL buf pointer
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 4 Sep 2019 09:04:07 +0000 (06:04 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 5 Sep 2019 09:26:57 +0000 (06:26 -0300)
commit6f51fdfd8229d5358c2d6e272cf73478866e8ddc
tree760a1129a097cb65cb0cd32d982ce8d658c5d61a
parent20a438d53fd9d12a894161bc56cbeab7a9993c39
media: videobuf-core.c: poll_wait needs a non-NULL buf pointer

poll_wait uses &buf->done, but buf is NULL. Move the poll_wait to later
in the function once buf is correctly set and only call it if it is
non-NULL.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: bb436cbeb918 ("media: videobuf: fix epoll() by calling poll_wait first")
Cc: <stable@vger.kernel.org> # for v5.1 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/v4l2-core/videobuf-core.c