From patchwork Thu Mar 3 21:21:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 8496191 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2CA1DC0553 for ; Thu, 3 Mar 2016 21:21:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A815201BC for ; Thu, 3 Mar 2016 21:21:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8535A2013D for ; Thu, 3 Mar 2016 21:21:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757853AbcCCVVu (ORCPT ); Thu, 3 Mar 2016 16:21:50 -0500 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 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 F2DD9462C1; Thu, 3 Mar 2016 13:21:48 -0800 (PST) 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 Organization: Samsung Open Source Group Message-ID: <56D8AAEC.8050204@osg.samsung.com> Date: Thu, 3 Mar 2016 14:21:48 -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: <56D8AA16.7040909@osg.samsung.com> 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=unavailable 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 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);