]> www.infradead.org Git - users/dwmw2/linux.git/commit
ASoC: meson: fix memory leak of links if allocation of ldata fails
authorColin Ian King <colin.king@canonical.com>
Thu, 4 Jun 2020 17:12:16 +0000 (18:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:48:30 +0000 (17:48 +0200)
commitd69eefd57e2a50fe5fd8f287b51b3c17d10424d1
treefb82b24be1666d1cec4d3b8a1f0db8216d175fe4
parentaeadf66a5db6de978dc94f99b8a10c0c34f05a48
ASoC: meson: fix memory leak of links if allocation of ldata fails

[ Upstream commit 6e801dc411329aff592fbd48fb116183d0acdb00 ]

Currently if the allocation of ldata fails the error return path
does not kfree the allocated links object.  Fix this by adding
an error exit return path that performs the necessary kfree'ing.

Fixes: 7864a79f37b5 ("ASoC: meson: add axg sound card support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Resource leak")
Link: https://lore.kernel.org/r/20200604171216.60043-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/meson/meson-card-utils.c