Commit 8b10fd62 authored by Hui Wang's avatar Hui Wang Committed by sanglipeng
Browse files

dmaengine: imx-sdma: Fix a possible memory leak in sdma_transfer_init

stable inclusion
from stable-v5.10.167
commit bd0050b7ffa87c7b260d563646af612f4112a778
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7TH9O

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bd0050b7ffa87c7b260d563646af612f4112a778



--------------------------------

[ Upstream commit 1417f59a ]

If the function sdma_load_context() fails, the sdma_desc will be
freed, but the allocated desc->bd is forgot to be freed.

We already met the sdma_load_context() failure case and the log as
below:
[ 450.699064] imx-sdma 30bd0000.dma-controller: Timeout waiting for CH0 ready
...

In this case, the desc->bd will not be freed without this change.

Signed-off-by: default avatarHui Wang <hui.wang@canonical.com>
Reviewed-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.kernel.org/r/20221130090800.102035-1-hui.wang@canonical.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 02c48170
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment