From patchwork Thu Mar 3 21:18:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 8496181 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5B4769F2F0 for ; Thu, 3 Mar 2016 21:18:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 773D7202FF for ; Thu, 3 Mar 2016 21:18:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EE79B2038F for ; Thu, 3 Mar 2016 21:18:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758019AbcCCVSR (ORCPT ); Thu, 3 Mar 2016 16:18:17 -0500 Received: from lists.s-osg.org ([54.187.51.154]:34544 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757972AbcCCVSQ (ORCPT ); Thu, 3 Mar 2016 16:18:16 -0500 Received: from [192.168.1.40] (c-73-181-52-62.hsd1.co.comcast.net [73.181.52.62]) by lists.s-osg.org (Postfix) with ESMTPSA id C0210462C1; Thu, 3 Mar 2016 13:18:15 -0800 (PST) Subject: Re: [PATCH v3 13/22] media: Change v4l-core to check if source is free To: Olli Salonen References: Cc: linux-media , Mauro Carvalho Chehab , Shuah Khan From: Shuah Khan Organization: Samsung Open Source Group Message-ID: <56D8AA16.7040909@osg.samsung.com> Date: Thu, 3 Mar 2016 14:18:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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@anduin:~/lkml/linux_media_feb27_2016$ git diff > temp.diff shuah@anduin:~/lkml/linux_media_feb27_2016$ cat temp.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);