[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87ldnmuy7o.wl-tiwai@suse.de>
Date: Thu, 14 Aug 2025 10:03:23 +0200
From: Takashi Iwai <tiwai@...e.de>
To: Šerif Rami <ramiserifpersia@...il.com>
Cc: Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
linux-kernel@...r.kernel.org,
linux-sound@...r.kernel.org
Subject: Re: [PATCH v4 5/7] ALSA: usb-audio: us144mkii: Add MIDI support and mixer controls
On Wed, 13 Aug 2025 15:15:16 +0200,
Šerif Rami wrote:
>
> +static int tascam_samplerate_get(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct tascam_card *tascam =
> + (struct tascam_card *)snd_kcontrol_chip(kcontrol);
> + u8 *buf __free(kfree) = NULL;
> + int err;
> + u32 rate = 0;
> +
> + guard(spinlock_irqsave)(&tascam->lock);
> + if (tascam->current_rate > 0) {
> + ucontrol->value.integer.value[0] = tascam->current_rate;
> + return 0;
> + }
> + // Lock is released here before kmalloc and usb_control_msg
No, the lock isn't released!
You must use scoped_guard() in this case.
> +void tascam_midi_out_urb_complete(struct urb *urb)
> +{
....
> + {
> + guard(spinlock_irqsave)(&tascam->midi_out_lock);
Use scoped_guard().
> +static void tascam_midi_out_work_handler(struct work_struct *work)
> +{
....
> + {
> + guard(spinlock_irqsave)(&tascam->midi_out_lock);
Ditto.
> + {
> + guard(spinlock_irqsave)(&tascam->midi_out_lock);
Here, too.
Try to grep and check similar patterns are seen in other patches,
too. I might have overlooked.
thanks,
Takashi
Powered by blists - more mailing lists