ALSA: line6: Don't forget to call driver's destructor at error path
authorTakashi Iwai <tiwai@suse.de>
Tue, 20 Jan 2015 08:09:27 +0000 (09:09 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 28 Jan 2015 06:19:55 +0000 (07:19 +0100)
Currently disconnect callback is used as a driver's destructor, and
this has to be called not only at the disconnection time but also at
the error paths during probe.

Tested-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/line6/driver.c

index 625272fe227a2cba073a930276e5e994874b6a9b..e7f9a99e1949cbc1e1f255d4d5d7ebbfa5c63c1c 100644 (file)
@@ -568,6 +568,8 @@ int line6_probe(struct usb_interface *interface,
        return 0;
 
  err_destruct:
+       if (line6->disconnect)
+               line6->disconnect(interface);
        snd_card_free(card);
  err_put:
        return ret;