From patchwork Wed May 4 04:39:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Lippers-Hollmann X-Patchwork-Id: 9009581 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 9BD759F1C1 for ; Wed, 4 May 2016 04:39:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BE64B2037F for ; Wed, 4 May 2016 04:39:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D3F1620380 for ; Wed, 4 May 2016 04:39:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750798AbcEDEjQ (ORCPT ); Wed, 4 May 2016 00:39:16 -0400 Received: from mout.gmx.net ([212.227.15.19]:53207 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750708AbcEDEjQ (ORCPT ); Wed, 4 May 2016 00:39:16 -0400 Received: from mir ([79.203.12.135]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MH07e-1atupt0Omo-00Dmjk; Wed, 04 May 2016 06:39:07 +0200 Date: Wed, 4 May 2016 06:39:02 +0200 From: Stefan Lippers-Hollmann To: Linus Torvalds Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Linux Kernel Mailing List Subject: Re: [GIT PULL for v4.6-rc1] media updates Message-ID: <20160504063902.0af2f4d7@mir> In-Reply-To: References: <20160315080552.3cc5d146@recife.lan> <20160503233859.0f6506fa@mir> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Provags-ID: V03:K0:Dx6h8ioWr5hVRfqA8hvuN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P 9W08DGi Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00,FREEMAIL_FROM, 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 Hi On 2016-05-03, Linus Torvalds wrote: > On Tue, May 3, 2016 at 2:38 PM, Stefan Lippers-Hollmann wrote: > > Hi > > [...] > >> Mauro Carvalho Chehab (95): > > [...] > >> [media] use v4l2_mc_usb_media_device_init() on most USB devices > > [...] > > > > This change, as part of v4.6-rc6-85-g1248ded, breaks two systems, each > > equipped with a TeVii s480 (dvb_usb_dw2102) DVB-S2 card, for me (kernel > > v4.5.3-rc1 is fine): > > From the oops it looks like the "->prev" pointer in one of the list > heads in 'mdev' is NULL. > > > [ 5.041915] BUG: unable to handle kernel NULL pointer dereference at (null) > > [ 5.041921] IP: [] media_gobj_create+0xb8/0x100 [media] > > I can't tell *which* list head it is, but it looks like there's a > missing call to media_device_init() which is what should have > initialized those list heads. > > Of course, maybe that list pointer got initialized but then > overwritten by NULL for some other reason. Just as a cross-check, this (incomplete, but au0828, cx231xx and em28xx aren't needed/ loaded on my system) crude revert avoids the problem for me on v4.6-rc6-113-g83858a7. While testing this, I also noticed that not just the dvb_usb based dvb_usb_dw2102 is affected, but that also the dvb_usb_v2 based rtl2832 triggers this Oops on its own (given that just reverting drivers/media/usb/dvb-usb/dvb-usb-dvb.c wasn't enough). Regards Stefan Lippers-Hollmann --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c +++ b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c @@ -107,7 +107,15 @@ static int dvb_usb_media_device_init(str if (!mdev) return -ENOMEM; - media_device_usb_init(mdev, udev, d->desc->name); + mdev->dev = &udev->dev; + strlcpy(mdev->model, d->desc->name, sizeof(mdev->model)); + if (udev->serial) + strlcpy(mdev->serial, udev->serial, sizeof(mdev->serial)); + strcpy(mdev->bus_info, udev->devpath); + mdev->hw_revision = le16_to_cpu(udev->descriptor.bcdDevice); + mdev->driver_version = LINUX_VERSION_CODE; + + media_device_init(mdev); dvb_register_media_controller(&adap->dvb_adap, mdev); --- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c @@ -412,7 +412,15 @@ static int dvb_usbv2_media_device_init(s if (!mdev) return -ENOMEM; - media_device_usb_init(mdev, udev, d->name); + mdev->dev = &udev->dev; + strlcpy(mdev->model, d->name, sizeof(mdev->model)); + if (udev->serial) + strlcpy(mdev->serial, udev->serial, sizeof(mdev->serial)); + strcpy(mdev->bus_info, udev->devpath); + mdev->hw_revision = le16_to_cpu(udev->descriptor.bcdDevice); + mdev->driver_version = LINUX_VERSION_CODE; + + media_device_init(mdev); dvb_register_media_controller(&adap->dvb_adap, mdev);