From: Takashi Iwai <tiwai@suse.de>
To: Ivan Orlov <ivan.orlov0322@gmail.com>
Cc: perex@perex.cz, tiwai@suse.com, corbet@lwn.net,
broonie@kernel.org, shuah@kernel.org,
linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
christophe.jaillet@wanadoo.fr, aholzinger@gmx.de
Subject: Re: [PATCH v4 3/4] ALSA: timer: Introduce virtual userspace-driven timers
Date: Tue, 13 Aug 2024 08:02:51 +0200 [thread overview]
Message-ID: <87ikw5c644.wl-tiwai@suse.de> (raw)
In-Reply-To: <20240811202337.48381-4-ivan.orlov0322@gmail.com>
On Sun, 11 Aug 2024 22:23:36 +0200,
Ivan Orlov wrote:
> +static int snd_utimer_ioctl_create(struct file *file,
> + struct snd_timer_uinfo __user *_utimer_info)
> +{
> + struct snd_utimer *utimer;
> + struct snd_timer_uinfo *utimer_info __free(kfree) = NULL;
> + int err;
> +
> + utimer_info = memdup_user(_utimer_info, sizeof(*utimer_info));
> + if (IS_ERR(utimer_info))
> + return PTR_ERR(no_free_ptr(utimer_info));
> +
> + err = snd_utimer_create(utimer_info, &utimer);
> + if (err < 0)
> + return err;
> +
> + utimer_info->id = utimer->id;
> +
> + err = copy_to_user(_utimer_info, utimer_info, sizeof(*utimer_info));
> + if (err) {
> + snd_utimer_free(utimer);
> + return -EFAULT;
> + }
> +
> + return anon_inode_getfd(utimer->name, &snd_utimer_fops, utimer, O_RDWR | O_CLOEXEC);
Wouldn't utimer be left unfreed if this returns an error?
thanks,
Takashi
next prev parent reply other threads:[~2024-08-13 6:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-11 20:23 [PATCH v4 0/4] Introduce userspace-driven ALSA timers Ivan Orlov
2024-08-11 20:23 ` [PATCH v4 1/4] ALSA: aloop: Allow using global timers Ivan Orlov
2024-08-11 20:23 ` [PATCH v4 2/4] Docs/sound: Add documentation for userspace-driven ALSA timers Ivan Orlov
2024-08-11 20:23 ` [PATCH v4 3/4] ALSA: timer: Introduce virtual userspace-driven timers Ivan Orlov
2024-08-13 6:02 ` Takashi Iwai [this message]
2024-08-13 7:03 ` Ivan Orlov
2024-08-11 20:23 ` [PATCH v4 4/4] selftests: ALSA: Cover userspace-driven timers with test Ivan Orlov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ikw5c644.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=aholzinger@gmx.de \
--cc=broonie@kernel.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=corbet@lwn.net \
--cc=ivan.orlov0322@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=shuah@kernel.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox