aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/line6/toneport.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/staging/line6/toneport.c b/drivers/staging/line6/toneport.c
index 69437158d383..660dc3f2aa61 100644
--- a/drivers/staging/line6/toneport.c
+++ b/drivers/staging/line6/toneport.c
@@ -433,12 +433,16 @@ void line6_toneport_reset_resume(struct usb_line6_toneport *toneport)
433void line6_toneport_disconnect(struct usb_interface *interface) 433void line6_toneport_disconnect(struct usb_interface *interface)
434{ 434{
435 struct usb_line6_toneport *toneport; 435 struct usb_line6_toneport *toneport;
436 struct snd_line6_pcm *line6pcm;
436 u16 idProduct; 437 u16 idProduct;
437 438
438 if (interface == NULL) 439 if (interface == NULL)
439 return; 440 return;
440 441
441 toneport = usb_get_intfdata(interface); 442 toneport = usb_get_intfdata(interface);
443 if (NULL == toneport)
444 return;
445
442 del_timer_sync(&toneport->timer); 446 del_timer_sync(&toneport->timer);
443 idProduct = le16_to_cpu(toneport->line6.usbdev->descriptor.idProduct); 447 idProduct = le16_to_cpu(toneport->line6.usbdev->descriptor.idProduct);
444 448
@@ -447,13 +451,10 @@ void line6_toneport_disconnect(struct usb_interface *interface)
447 device_remove_file(&interface->dev, &dev_attr_led_green); 451 device_remove_file(&interface->dev, &dev_attr_led_green);
448 } 452 }
449 453
450 if (toneport != NULL) { 454 line6pcm = toneport->line6.line6pcm;
451 struct snd_line6_pcm *line6pcm = toneport->line6.line6pcm; 455 if (line6pcm != NULL) {
452 456 line6_pcm_release(line6pcm, LINE6_BITS_PCM_MONITOR);
453 if (line6pcm != NULL) { 457 line6_pcm_disconnect(line6pcm);
454 line6_pcm_release(line6pcm, LINE6_BITS_PCM_MONITOR);
455 line6_pcm_disconnect(line6pcm);
456 }
457 } 458 }
458 459
459 toneport_destruct(interface); 460 toneport_destruct(interface);