[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1457058298-7782-1-git-send-email-shuahkh@osg.samsung.com>
Date: Thu, 3 Mar 2016 19:24:58 -0700
From: Shuah Khan <shuahkh@....samsung.com>
To: mchehab@....samsung.com, olli.salonen@....fi
Cc: Shuah Khan <shuahkh@....samsung.com>, linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] media: fix null pointer dereference in v4l_vb2q_enable_media_source()
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@....samsung.com>
Reported-by: Olli Salonen <olli.salonen@....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
Powered by blists - more mailing lists