From patchwork Fri Mar 18 23:00:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 8624231 Return-Path: X-Original-To: patchwork-alsa-devel@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 19EECC0553 for ; Fri, 18 Mar 2016 23:00:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 008FA20397 for ; Fri, 18 Mar 2016 23:00:52 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7E78E20396 for ; Fri, 18 Mar 2016 23:00:50 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id B88E72666FF; Sat, 19 Mar 2016 00:00:43 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 2BB582615F7; Sat, 19 Mar 2016 00:00:36 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id E74D72617B8; Sat, 19 Mar 2016 00:00:34 +0100 (CET) Received: from mail-io0-f174.google.com (mail-io0-f174.google.com [209.85.223.174]) by alsa0.perex.cz (Postfix) with ESMTP id D3181261560 for ; Sat, 19 Mar 2016 00:00:27 +0100 (CET) Received: by mail-io0-f174.google.com with SMTP id m184so154273409iof.1 for ; Fri, 18 Mar 2016 16:00:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-transfer-encoding; bh=sgzHG13XGIUOcR7QTJgcB3+opeoYqjWu3pGo37iPoZo=; b=dAkTjvTBNnzaswSd2aniRjBm19fL6CoNswtMoZA6gJFr376vaOxiwxgZ2Y6jwNDafy cST2cC0fljvY43HQPd3TlS/k/Q6Fd+rjSo9mm27V+ENOWCjX1OQ1I8vY/yvwnG5/Ro5H kEu8+Y5AXORG5eNTdX5nlmshq6q+YGuCi1TZ17Y4VKDQhCqpwYJtlmzVBUxZnHOJWKM9 GTBjoVKjLBLZAjgludJSQW2iFZRK42XkXNORa0VKY76oJmFxIFwAMzzKb05bIV+mvT0p K0AkZASGhY5NH0mzdU5oAdbaHTGV8UPEIBw+DXnZkBW0I9xDrs692hgYUDTTZzCkD/G+ qxNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-transfer-encoding; bh=sgzHG13XGIUOcR7QTJgcB3+opeoYqjWu3pGo37iPoZo=; b=UCWQlTjwjHFLxhMGIW29AOSM0LC7E7ZQMXQErsgXJrsUGjX7reTUF2q8Wl2DYb9cjC jwOQWauuiH78CVoecto3/oipqQqoa7R8JcN8nHdp4I8Q9To4R22YlbIO6FY2YrlY6wT1 H8kZuLUmdVHOLxa1cEysl8CsgAOYV+V2XQ6pIYcVLuNB5Bf6ahUponeDgM0S1cuqpA58 e7hxDokfaHgdi4g47mofBP9hoH7RH+Nyn4V8+SETh8KZ6WeV8ChStH9972YjBIHu9VxY lfPOlJkNk6Q8Sa042LKi8dh7/qVjYihHSnDIow2KdRAQDaJAK0HErFiRrA+tilr+2kOR uhZg== X-Gm-Message-State: AD7BkJKxQBQzxaPJhnvaio6UigzLUxvgWmU7Ok9GT9rEJQ2B1weRF2rKNKunpWyvxdc68t9x46YUn1knoiUQXg== MIME-Version: 1.0 X-Received: by 10.107.38.82 with SMTP id m79mt19584728iom.2.1458342025669; Fri, 18 Mar 2016 16:00:25 -0700 (PDT) Received: by 10.64.146.195 with HTTP; Fri, 18 Mar 2016 16:00:25 -0700 (PDT) In-Reply-To: <20160318222625.GA1200@kroah.com> References: <20160318222625.GA1200@kroah.com> Date: Fri, 18 Mar 2016 17:00:25 -0600 X-Google-Profiles: ANGjdJ8l3-9Xl648YK5QIdQbmk4jNjL0KHNXakShVVVtpyReTPfEgcosG2t5TMtjqunjtFV4yMY6rfX0oLXfBEG1Jc2vUB-2-zv4TFjv3fVV7KdIXDiOKGbWXjhvFJs Message-ID: From: Shuah Khan To: Greg KH Cc: alsa-devel@alsa-project.org, linux-usb@vger.kernel.org, LKML , "Mauro Carvalho Chehab \(Google+\)" , Takashi Iwai , Linus Torvalds Subject: Re: [alsa-devel] USB Sound oops in Linus's latest tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Mar 18, 2016 at 4:26 PM, Greg KH wrote: > Hi, > > I'm getting the following oops with my USB sound device using Linus's > latest tree of the moment, which has the sound tree pull in it. Anyone > seen this before? > Hi Greg, Nicolai Stange sent in a fix for this problem - I can't find the link to this. It is coming in through Linux Media tree. thanks, -- Shuah The patch: With commit aebb2b89bff0 ("[media] sound/usb: Use Media Controller API to share media resources") an access to quirk->media_device without checking for quirk != NULL has been introduced in usb_audio_probe(). With a Plantronics USB headset (device ID 0x047f:0xc010) attached, this results in the following splat at boot time: BUG: unable to handle kernel NULL pointer dereference at 0000000000000014 IP: [] usb_audio_probe+0x2cc/0x9a0 [snd_usb_audio] Oops: 0000 [#1] SMP [...] CPU: 2 PID: 696 Comm: systemd-udevd Not tainted 4.5.0-next-20160315 #13 Hardware name: Dell Inc. Latitude E6540/0725FP, BIOS A10 06/26/2014 task: ffff88021c88d7c0 ti: ffff88003d5b0000 task.ti: ffff88003d5b0000 RIP: 0010:[] [] usb_audio_probe+0x2cc/0x9a0 [snd_usb_audio] [...] Call Trace: [] usb_probe_interface+0x136/0x2d0 [] driver_probe_device+0x22c/0x440 [] __driver_attach+0xd1/0xf0 [] ? driver_probe_device+0x440/0x440 [] bus_for_each_dev+0x6c/0xc0 [] driver_attach+0x1e/0x20 [] bus_add_driver+0x1c3/0x280 [] driver_register+0x60/0xe0 [] usb_register_driver+0x81/0x140 [] ? 0xffffffffa08c7000 [] usb_audio_driver_init+0x1e/0x1000 [snd_usb_audio] [] do_one_initcall+0xb3/0x1f0 [] ? __vunmap+0x81/0xd0 [] ? kmem_cache_alloc_trace+0x182/0x1d0 [] ? do_init_module+0x27/0x1d8 [] do_init_module+0x5f/0x1d8 [] load_module+0x1fe5/0x27a0 [] ? __symbol_put+0x60/0x60 [] ? vfs_read+0x110/0x130 [] SYSC_finit_module+0xe6/0x120 [] SyS_finit_module+0xe/0x10 [] do_syscall_64+0x64/0x110 [] entry_SYSCALL64_slow_path+0x25/0x25 After encountering this, the system-udevd process seems to be blocked until it is killed when hitting its timeout of 3min. In analogy to the other accesses to members of quirk in usb_audio_probe(), check for quirk != NULL before accessing its ->media_device. Fixes: aebb2b89bff0 ("[media] sound/usb: Use Media Controller API to share media resources") Signed-off-by: Nicolai Stange --- Applicable to linux-next-20160315. sound/usb/card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/usb/card.c b/sound/usb/card.c index 63244bb..479621e 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c @@ -612,7 +612,7 @@ static int usb_audio_probe(struct usb_interface *intf, if (err < 0) goto __error; - if (quirk->media_device) { + if (quirk && quirk->media_device) { /* don't want to fail when media_snd_device_create() fails */ media_snd_device_create(chip, intf); }