From: Lars-Peter Clausen <lars@metafoo.de>
To: Takashi Iwai <tiwai@suse.de>, alsa-devel@alsa-project.org
Subject: Re: [PATCH 03/14] ALSA: Add a helper to initialize device
Date: Mon, 02 Feb 2015 14:31:40 +0100 [thread overview]
Message-ID: <54CF7C3C.6020100@metafoo.de> (raw)
In-Reply-To: <1422872678-4815-4-git-send-email-tiwai@suse.de>
On 02/02/2015 11:24 AM, Takashi Iwai wrote:
> diff --git a/sound/core/init.c b/sound/core/init.c
> index 074875d68c15..2f730efe97b6 100644
> --- a/sound/core/init.c
> +++ b/sound/core/init.c
> @@ -157,6 +157,25 @@ static int get_slot_from_bitmask(int mask, int (*check)(struct module *, int),
> return mask; /* unchanged */
> }
>
> +static void default_release(struct device *dev)
> +{
> +}
A empty release callback is pretty much always wrong and typically causes
use-after-free bugs. It might be correct in this case, but there should at
least be a comment explaining why it is correct. And on the long run things
should probably be re-factored to do all memory freeing in a subdevice
specific release function.
- Lars
next prev parent reply other threads:[~2015-02-02 13:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-02 10:24 [PATCH 00/14] Refactoring ALSA core device management Takashi Iwai
2015-02-02 10:24 ` [PATCH 01/14] ALSA: Allow to pass the device object to snd_register_device*() Takashi Iwai
2015-02-02 10:24 ` [PATCH 02/14] ALSA: control: Provide a helper to look for the preferred subdevice Takashi Iwai
2015-02-02 10:24 ` [PATCH 03/14] ALSA: Add a helper to initialize device Takashi Iwai
2015-02-02 13:31 ` Lars-Peter Clausen [this message]
2015-02-02 13:40 ` Takashi Iwai
2015-02-02 13:43 ` Lars-Peter Clausen
2015-02-02 13:53 ` Takashi Iwai
2015-02-02 10:24 ` [PATCH 04/14] ALSA: control: Embed struct device Takashi Iwai
2015-02-02 10:24 ` [PATCH 05/14] ALSA: hwdep: " Takashi Iwai
2015-02-02 10:24 ` [PATCH 06/14] ALSA: pcm: " Takashi Iwai
2015-02-02 10:24 ` [PATCH 07/14] ALSA: rawmidi: " Takashi Iwai
2015-02-02 10:24 ` [PATCH 08/14] ALSA: rawmidi: Use rawmidi device file for kernel messages Takashi Iwai
2015-02-02 10:24 ` [PATCH 09/14] ALSA: timer: Propagate the error at initialization Takashi Iwai
2015-02-02 10:24 ` [PATCH 10/14] ALSA: timer: Handle the device directly Takashi Iwai
2015-02-02 10:24 ` [PATCH 11/14] ALSA: seq: " Takashi Iwai
2015-02-02 10:24 ` [PATCH 12/14] ALSA: compress: Embed struct device Takashi Iwai
2015-02-02 10:24 ` [PATCH 13/14] ALSA: Simplify snd_device_register() variants Takashi Iwai
2015-02-02 10:24 ` [PATCH 14/14] ALSA: Drop snd_get_device() helper Takashi Iwai
2015-02-02 11:01 ` [PATCH 00/14] Refactoring ALSA core device management Jaroslav Kysela
2015-02-02 13:25 ` Takashi Iwai
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=54CF7C3C.6020100@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=tiwai@suse.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.