]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
dmaengine: ti: dma-crossbar: Fix a memory leak bug
authorWenwen Wang <wenwen@cs.uga.edu>
Fri, 16 Aug 2019 06:48:55 +0000 (01:48 -0500)
committerKhalid Elmously <khalid.elmously@canonical.com>
Thu, 26 Sep 2019 04:34:52 +0000 (00:34 -0400)
commit29f7e69ad53e267813ff9f44b8547b676a477379
treefa68fa9829aa4849c3d45f76ba9a8ddc7ff91db0
parentcd9f95ef47f5154cd0e94e0fd145c3ab61453e7a
dmaengine: ti: dma-crossbar: Fix a memory leak bug

BugLink: https://bugs.launchpad.net/bugs/1845266
[ Upstream commit 2c231c0c1dec42192aca0f87f2dc68b8f0cbc7d2 ]

In ti_dra7_xbar_probe(), 'rsv_events' is allocated through kcalloc(). Then
of_property_read_u32_array() is invoked to search for the property.
However, if this process fails, 'rsv_events' is not deallocated, leading to
a memory leak bug. To fix this issue, free 'rsv_events' before returning
the error.

Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/1565938136-7249-1-git-send-email-wenwen@cs.uga.edu
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/dma/ti-dma-crossbar.c