[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87jz37y5t6.wl-tiwai@suse.de>
Date: Wed, 13 Aug 2025 10:38:45 +0200
From: Takashi Iwai <tiwai@...e.de>
To: Šerif Rami <ramiserifpersia@...il.com>
Cc: perex@...ex.cz,
tiwai@...e.com,
linux-kernel@...r.kernel.org,
linux-sound@...r.kernel.org
Subject: Re: [PATCH v3 3/7] ALSA: usb-audio: us144mkii: Implement audio playback and feedback
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
Powered by blists - more mailing lists