Message ID | s5hinfevswy.wl-tiwai@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Oct 17, 2017 at 02:51:41PM +0200, Takashi Iwai wrote: > On Tue, 17 Oct 2017 14:46:53 +0200, > Arnd Bergmann wrote: > > > > On Tue, Oct 17, 2017 at 12:22 PM, Olof's autobuilder <build@lixom.net> wrote: > > > Warnings: > > > > > > 9 sound/usb/mixer.c:2161:27: warning: passing argument 1 of 'snd_usb_mixer_disconnect' from incompatible pointer type [-Wincompatible-pointer-types] > > > > This broke after backporting 124751d5e63c ("ALSA: usb-audio: Kill stray > > URB at exiting") into linux-3.18. > > > > The interface was changed in commit a6cece9d8199 ("ALSA: usb-audio: > > Pass direct struct pointer instead of list_head"), which was merged in > > linux-3.19. > > > > I don't immediately see how this can be fixed. Backporting a6cece9d8199 > > would probably work. > > I already posted the revised patch yesterday, but apparently this > seems overlooked: > > Subject: Re: [PATCH 3.18 08/19] ALSA: usb-audio: Kill stray URB at exiting > From: Takashi Iwai <tiwai@suse.de> > Date: Mon, 16 Oct 2017 20:50:02 +0200 > Message-ID: <s5hpo9nylk5.wl-tiwai@suse.de> > > The same patch is attached below. > > Greg, could you replace the broken one? Now replaced, thanks, and sorry for the delay. greg k-h
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 1ceeb9e875a4..d0bbc7b32190 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -2157,6 +2157,9 @@ static int parse_audio_unit(struct mixer_build *state, int unitid) static void snd_usb_mixer_free(struct usb_mixer_interface *mixer) { + /* kill pending URBs */ + snd_usb_mixer_disconnect(&mixer->list); + kfree(mixer->id_elems); if (mixer->urb) { kfree(mixer->urb->transfer_buffer); @@ -2493,8 +2496,13 @@ void snd_usb_mixer_disconnect(struct list_head *p) struct usb_mixer_interface *mixer; mixer = list_entry(p, struct usb_mixer_interface, list); - usb_kill_urb(mixer->urb); - usb_kill_urb(mixer->rc_urb); + if (mixer->disconnected) + return; + if (mixer->urb) + usb_kill_urb(mixer->urb); + if (mixer->rc_urb) + usb_kill_urb(mixer->rc_urb); + mixer->disconnected = true; } #ifdef CONFIG_PM diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h index 73b1f649447b..cdff31de12d4 100644 --- a/sound/usb/mixer.h +++ b/sound/usb/mixer.h @@ -23,6 +23,7 @@ struct usb_mixer_interface { u8 audigy2nx_leds[3]; u8 xonar_u1_status; + bool disconnected; }; #define MAX_CHANNELS 16 /* max logical channels */