diff options
author | Takashi Iwai <tiwai@suse.de> | 2017-10-09 14:26:27 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-18 09:38:29 +0200 |
commit | 9d88463d14579d031010caf7362634b00a5600fb (patch) | |
tree | e42661e071d2f368547720dabc075a626b33c20e /sound | |
parent | 420c705bc82fe23b9ee4ccaf0febf79099dc44bb (diff) |
ALSA: line6: Fix NULL dereference at podhd_disconnect()
commit 54a4b2b45817ea2365b40c923c098a26af0c0dbb upstream.
When podhd_init() failed with the acquiring a ctrl i/f, the line6
helper still calls the disconnect callback that eventually calls again
usb_driver_release_interface() with the NULL intf.
Put the proper NULL check before calling it for avoiding an Oops.
Fixes: fc90172ba283 ("ALSA: line6: Claim pod x3 usb data interface")
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/usb/line6/podhd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/usb/line6/podhd.c b/sound/usb/line6/podhd.c index 956f847a96e4..cfcd80092a54 100644 --- a/sound/usb/line6/podhd.c +++ b/sound/usb/line6/podhd.c @@ -301,7 +301,8 @@ static void podhd_disconnect(struct usb_line6 *line6) intf = usb_ifnum_to_if(line6->usbdev, pod->line6.properties->ctrl_if); - usb_driver_release_interface(&podhd_driver, intf); + if (intf) + usb_driver_release_interface(&podhd_driver, intf); } } |