]> git.baikalelectronics.ru Git - kernel.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)
committerMark Brown <broonie@kernel.org>
Fri, 5 Jun 2020 11:13:03 +0000 (12:13 +0100)
commit114abf3b24254956a37a24036242aaedd0ac54f8
tree1fd9b044f7b74e3d08f82ed8d946dcabe4eb8282
parent65ba9804a44ed8dedd95d6d6e233561520eb80f2
ASoC: meson: fix memory leak of links if allocation of ldata fails

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: ee085b8b0c32 ("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>
sound/soc/meson/meson-card-utils.c