All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: Takashi Iwai <tiwai@suse.de>
Cc: onkel@paraair.de, alsa-devel@alsa-project.org
Subject: Re: [PATCH 4/5] ALSA: usb-audio: deallocate memory objects in error path
Date: Wed, 22 Feb 2017 07:59:31 +0900	[thread overview]
Message-ID: <0f1bb4cb-daa3-7dd9-aa55-990b67c34a38@sakamocchi.jp> (raw)
In-Reply-To: <c4b1c062-2099-bd14-0bc2-5a2f9b1d30ab@sakamocchi.jp>

On Feb 22 2017 07:45, Takashi Sakamoto wrote:
> On Fe 21 2017 11:32, Takashi Sakamoto wrote:
>> But it's wrong. The allocated memory objects are used for private data
>> for each control element set. I didn't care of it...
>>
>> Here, what I should fix is just for error path. I'll post revised
>> version of this patch this night.
>
> I realize that this is not concern because the code includes assignment
> deallocate function to each control element set. Thus, in error path,
> the allocated private data is going to free in below callgrach.
>
> (sound/usb/mixer_us16x08.c)
> add_new_ctl(elem)
>   kctl->private_free = freeer;
>   (sound/usb/mixer.c)
>   ->snd_usb_mixer_add_control(kctl)
>     (sound/core/control.c)
>     ->snd_ctl_add(kctl)
>       ->snd_ctl_free_one(kctl)
>         (in error path)
>         ->kcontrol->private_free(kctl);
>         (sound/usb/mixer_us16x08.c)
>         = freeer()

Oops. On the other hand, the private data for unregistered control 
element set is not deallocated automatically in error path of the other 
control element set. It should be fixed...


Regards

Takashi Sakamoto

  reply	other threads:[~2017-02-21 22:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20 20:09 [PATCH 0/5] ALSA: usb-audio: fixes for quirks of Tascam US-16x08 Takashi Sakamoto
2017-02-20 20:09 ` [PATCH 1/5] ALSA: usb-audio: localize one-referrer variable Takashi Sakamoto
2017-02-20 20:51   ` Takashi Iwai
2017-02-20 20:09 ` [PATCH 2/5] ALSA: usb-audio: purge needless variable length array Takashi Sakamoto
2017-02-20 20:51   ` Takashi Iwai
2017-02-20 21:04     ` Takashi Iwai
2017-02-21  2:23       ` Takashi Sakamoto
2017-02-20 20:09 ` [PATCH 3/5] ALSA: usb-audio: localize function without external linkage Takashi Sakamoto
2017-02-20 20:52   ` Takashi Iwai
2017-02-20 20:09 ` [PATCH 4/5] ALSA: usb-audio: deallocate memory objects in error path Takashi Sakamoto
2017-02-20 20:49   ` Takashi Iwai
2017-02-21  2:32     ` Takashi Sakamoto
2017-02-21 22:45       ` Takashi Sakamoto
2017-02-21 22:59         ` Takashi Sakamoto [this message]
2017-02-22  1:42           ` Takashi Sakamoto
2017-02-22  7:44             ` Takashi Iwai
2017-02-22  7:46               ` Takashi Iwai
2017-02-22 13:37                 ` Takashi Sakamoto
2017-02-22 14:05                   ` Takashi Iwai
2017-02-22 13:20               ` Takashi Sakamoto
2017-02-20 20:09 ` [PATCH 5/5] ALSA: usb-audio: fix msleep timeout due to minimum resolution of task scheduling Takashi Sakamoto
2017-02-20 20:51   ` 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=0f1bb4cb-daa3-7dd9-aa55-990b67c34a38@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=onkel@paraair.de \
    --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.