Re: [PATCH v3 3/7] ALSA: usb-audio: us144mkii: Implement audio playback and feedback
From: Takashi Iwai
Date: Wed Aug 13 2025 - 04:39:57 EST
On Tue, 12 Aug 2025 15:22:05 +0200,
Šerif Rami wrote:
>
> +/**
> + * fpoInitPattern() - Generates a packet distribution pattern.
You forgot to correct the name here :)
> +int us144mkii_configure_device_for_rate(struct tascam_card *tascam, int rate)
> +{
> + struct usb_device *dev = tascam->dev;
> +
Drop a blank line here.
> + u8 *rate_payload_buf __free(kfree) = NULL;
So you're using __free(kfree), then...
> + if (err < 0)
> + goto fail;
> +
> + kfree(rate_payload_buf);
You shouldn't use kfree(), otherwise it results in the double-free.
> + return 0;
> +
> +fail:
> + dev_err(&dev->dev,
> + "Device configuration failed at rate %d with error %d\n", rate,
> + err);
> + kfree(rate_payload_buf);
Here, too. Just drop kfree() calls, and that's the advantage of
__free(kfree), after all.
> +void playback_urb_complete(struct urb *urb)
....
> + {
> + guard(spinlock_irqsave)(&tascam->lock);
Use scoped_guard() instead. I think a similar pattern is seen in a
few other places in patches, too.
thanks,
Takashi