]> 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)
commitb8160c96bb01709a37df5387020ae06bc251bbf0
tree1fd9b044f7b74e3d08f82ed8d946dcabe4eb8282
parent2ec740bb5907fa9f1112d473c628ad9412a7e2d9
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: dd687ed938e3 ("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