]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Oct 2019 11:14:05 +0000 (13:14 +0200)
commit682dbe2cb5e7090b230c7a574c0f8b3be45a6d75
treeacf1ab543873b167bfc02d5a0a1cc022393ddfdd
parente1bbf7d2cd2181f336d612ae47a560cb2f644427
media: videobuf-core.c: poll_wait needs a non-NULL buf pointer

commit 6f51fdfd8229d5358c2d6e272cf73478866e8ddc upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/v4l2-core/videobuf-core.c