Bug 51201 - Kernel crashes at snd_usbmidi_output_close() when device is removed
Summary: Kernel crashes at snd_usbmidi_output_close() when device is removed
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-01 12:34 UTC by Mauro Carvalho Chehab
Modified: 2013-11-13 17:28 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.6.7-4.fc17.x86_64
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Kernel OOPS message (5.36 KB, application/octet-stream)
2012-12-01 12:34 UTC, Mauro Carvalho Chehab
Details
lsusb for DigiTech RP255 Guitar Multi-Effects Processor (14.39 KB, application/octet-stream)
2012-12-01 12:36 UTC, Mauro Carvalho Chehab
Details
patch1 (3.37 KB, patch)
2012-12-04 07:04 UTC, Takashi Iwai
Details | Diff
patch2 (6.80 KB, patch)
2012-12-04 07:04 UTC, Takashi Iwai
Details | Diff

Description Mauro Carvalho Chehab 2012-12-01 12:34:36 UTC
Created attachment 88041 [details]
Kernel OOPS message

There's something wrong at snd_usbmidi_output_close(). When using gdigi with a Digitech RP-255 pedal, sometimes I disconnect the pedal before closing gdigi.

When gdigi is later closed, Kernel panics at snd_usbmidi_output_close(). I suspect that there are some missing tests there, to see if the device's data
are still there.

The end result is a Kernel panic:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000190
IP: [<ffffffff8143fb54>] usb_autopm_put_interface+0x14/0x40
...
Call Trace:
[<ffffffffa078f809>] snd_usbmidi_output_close+0x29/0x40 [snd_usbmidi_lib]
...

I'm attaching the full OOPS message, and the lsusb -v info of the device.
Comment 1 Mauro Carvalho Chehab 2012-12-01 12:36:15 UTC
Created attachment 88051 [details]
lsusb for DigiTech RP255 Guitar Multi-Effects Processor
Comment 2 Takashi Iwai 2012-12-04 07:03:51 UTC
The patches below should fix the issue.  Please try them out.
These were merged in sound git tree for-next branch, too.
    git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
Comment 3 Takashi Iwai 2012-12-04 07:04:13 UTC
Created attachment 88381 [details]
patch1
Comment 4 Takashi Iwai 2012-12-04 07:04:33 UTC
Created attachment 88391 [details]
patch2
Comment 5 Florian Mickler 2012-12-22 09:21:00 UTC
A patch referencing this bug report has been merged in Linux v3.8-rc1:

commit 59866da9e4ae54819e3c4e0a8f426bdb0c2ef993
Author: Takashi Iwai <tiwai@suse.de>
Date:   Mon Dec 3 11:12:46 2012 +0100

    ALSA: usb-audio: Avoid autopm calls after disconnection

Note You need to log in before you can comment on or make changes to this bug.