Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Malaya Kumar Rout <malayarout91@gmail.com>
Cc: linux-kernel@vger.kernel.org, mrout@redhat.com,
	skhan@linuxfoundation.org, me@brighamcampbell.com,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>, Shuah Khan <shuah@kernel.org>,
	linux-sound@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH] selftests/alsa: Fix memory leak in find_controls error path
Date: Sun, 05 Jul 2026 09:39:50 +0200	[thread overview]
Message-ID: <87y0fp6g1l.wl-tiwai@suse.de> (raw)
In-Reply-To: <20260704105736.94874-1-malayarout91@gmail.com>

On Sat, 04 Jul 2026 12:57:36 +0200,
Malaya Kumar Rout wrote:
> 
> In find_controls(), card_data is allocated with malloc() but when
> snd_ctl_open_lconf() fails, the code jumps to next_card without
> freeing the allocated memory. This results in a memory leak for
> each card where snd_ctl_open_lconf() fails.
> 
> Add free(card_data) before goto next_card to ensure proper cleanup
> of the allocated memory in the error path.
> 
> Fixes: 5aaf9efffc57 ("kselftest: alsa: Add simplistic test for ALSA mixer controls kselftest")
> Signed-off-by: Malaya Kumar Rout <malayarout91@gmail.com>

Applied now.  Thanks.


Takashi

      reply	other threads:[~2026-07-05  7:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-04 10:57 [PATCH] selftests/alsa: Fix memory leak in find_controls error path Malaya Kumar Rout
2026-07-05  7:39 ` Takashi Iwai [this message]

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=87y0fp6g1l.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=malayarout91@gmail.com \
    --cc=me@brighamcampbell.com \
    --cc=mrout@redhat.com \
    --cc=perex@perex.cz \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.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