From: Olli Salonen <olli.salonen@iki.fi>
To: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
linux-media <linux-media@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: fix null pointer dereference in v4l_vb2q_enable_media_source()
Date: Fri, 4 Mar 2016 06:34:04 +0200 [thread overview]
Message-ID: <CAAZRmGyuEQ=LY=21VEXwz-yy3sodrGaMxSVoPj4zZrdZOr1zgQ@mail.gmail.com> (raw)
In-Reply-To: <1457058298-7782-1-git-send-email-shuahkh@osg.samsung.com>
Hi Shuah,
Thanks for your quick reaction. This patch seems to fix the oops I got earlier.
Tested-by: Olli Salonen <olli.salonen@iki.fi>
Cheers,
-olli
On 4 March 2016 at 04:24, Shuah Khan <shuahkh@osg.samsung.com> wrote:
> Fix the null pointer dereference in v4l_vb2q_enable_media_source().
> DVB only drivers don't have valid struct v4l2_fh pointer.
>
> [ 548.443272] BUG: unable to handle kernel NULL pointer dereference
> at 0000000000000010
> [ 548.452036] IP: [<ffffffffc020ffc9>]
> v4l_vb2q_enable_media_source+0x9/0x50 [videodev]
> [ 548.460792] PGD b820e067 PUD bb3df067 PMD 0
> [ 548.465582] Oops: 0000 [#1] SMP
>
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> Reported-by: Olli Salonen <olli.salonen@iki.fi>
> ---
> drivers/media/v4l2-core/v4l2-mc.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/v4l2-core/v4l2-mc.c b/drivers/media/v4l2-core/v4l2-mc.c
> index 643686d..a39a3cd 100644
> --- a/drivers/media/v4l2-core/v4l2-mc.c
> +++ b/drivers/media/v4l2-core/v4l2-mc.c
> @@ -214,6 +214,8 @@ int v4l_vb2q_enable_media_source(struct vb2_queue *q)
> {
> struct v4l2_fh *fh = q->owner;
>
> - return v4l_enable_media_source(fh->vdev);
> + if (fh && fh->vdev)
> + return v4l_enable_media_source(fh->vdev);
> + return 0;
> }
> EXPORT_SYMBOL_GPL(v4l_vb2q_enable_media_source);
> --
> 2.5.0
>
prev parent reply other threads:[~2016-03-04 4:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-04 2:24 [PATCH] media: fix null pointer dereference in v4l_vb2q_enable_media_source() Shuah Khan
2016-03-04 4:34 ` Olli Salonen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAAZRmGyuEQ=LY=21VEXwz-yy3sodrGaMxSVoPj4zZrdZOr1zgQ@mail.gmail.com' \
--to=olli.salonen@iki.fi \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
--cc=shuahkh@osg.samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).