This makes the resource freeing not dependent on the existence of private data from the podhd module, which may be gone during the call. Signed-off-by: Andrej Krutak <dev@xxxxxxxxx> --- sound/usb/line6/driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c index 344465f..142e0e3 100644 --- a/sound/usb/line6/driver.c +++ b/sound/usb/line6/driver.c @@ -479,13 +479,14 @@ static void line6_destruct(struct snd_card *card) struct usb_device *usbdev = line6->usbdev; /* free buffer memory first: */ - if (line6->properties->capabilities & LINE6_CAP_CONTROL_MIDI) + if (line6->buffer_message) kfree(line6->buffer_message); kfree(line6->buffer_listen); /* then free URBs: */ usb_free_urb(line6->urb_listen); + line6->urb_listen = NULL; /* decrement reference counters: */ usb_put_dev(usbdev); -- 1.9.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@xxxxxxxxxxxxxxxx http://mailman.alsa-project.org/mailman/listinfo/alsa-devel