From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from lists.s-osg.org ([54.187.51.154]:34554 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757605AbcCCVVu (ORCPT ); Thu, 3 Mar 2016 16:21:50 -0500 Subject: Re: [PATCH v3 13/22] media: Change v4l-core to check if source is free To: Olli Salonen References: <56D8AA16.7040909@osg.samsung.com> Cc: linux-media , Mauro Carvalho Chehab , Shuah Khan From: Shuah Khan Message-ID: <56D8AAEC.8050204@osg.samsung.com> Date: Thu, 3 Mar 2016 14:21:48 -0700 MIME-Version: 1.0 In-Reply-To: <56D8AA16.7040909@osg.samsung.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org List-ID: On 03/03/2016 02:18 PM, Shuah Khan wrote: > On 03/03/2016 01:39 PM, Olli Salonen wrote: >> Hello Shuah, >> >> This patch seems to cause issues with my setup. Basically, when I try >> to tune to a channel, I get an oops. I'm using TechnoTrend CT2-4650 >> PCIe DVB-T tuner (cx23885). >> >> Here's the oops: >> >> [ 548.443272] BUG: unable to handle kernel NULL pointer dereference >> at 0000000000000010 >> [ 548.452036] IP: [] >> v4l_vb2q_enable_media_source+0x9/0x50 [videodev] > > Hi Olli, > > Will you be able to use gdb and tell me which source line is > the cause? Could you give this following patch a try and if it > fixes the problem? > > thanks, > -- Shuah > Sorry - diff included twice: here is the correct diff: 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); -- Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America (Silicon Valley) shuahkh@osg.samsung.com | (970) 217-8978