aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-20 03:58:54 -0500
committerTakashi Iwai <tiwai@suse.de>2015-01-28 01:19:29 -0500
commit2a324fcdb568f4d7b0b65b271039beb987f6e1cd (patch)
treebcef41067ca5ad1729e279bc31433664e76f1fc3
parent270fd9c7f91fe8be900ede740ceeaa4abefa5d98 (diff)
ALSA: line6: Abort if inconsistent usbdev is found at disconnect
It's utterly unsafe to proceed further the disconnect procedure if the assigned usbdev is inconsistent with the expected object. Better to put a WARN_ON() for more cautions and abort immediately. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/usb/line6/driver.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c
index e8d51381ffdb..625272fe227a 100644
--- a/sound/usb/line6/driver.c
+++ b/sound/usb/line6/driver.c
@@ -585,12 +585,12 @@ void line6_disconnect(struct usb_interface *interface)
585 if (!line6) 585 if (!line6)
586 return; 586 return;
587 587
588 if (WARN_ON(usbdev != line6->usbdev))
589 return;
590
588 if (line6->urb_listen != NULL) 591 if (line6->urb_listen != NULL)
589 line6_stop_listen(line6); 592 line6_stop_listen(line6);
590 593
591 if (usbdev != line6->usbdev)
592 dev_err(line6->ifcdev, "driver bug: inconsistent usb device\n");
593
594 snd_card_disconnect(line6->card); 594 snd_card_disconnect(line6->card);
595 if (line6->line6pcm) 595 if (line6->line6pcm)
596 line6_pcm_disconnect(line6->line6pcm); 596 line6_pcm_disconnect(line6->line6pcm);