]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
a38fd43184d7583aa85eefc3956378bb33ff00c2
[thirdparty/kernel/stable-queue.git] /
1 From d645148cc82ca7fbacaa601414a552184e9c6dd3 Mon Sep 17 00:00:00 2001
2 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
3 Date: Sat, 19 Dec 2020 14:28:00 +0100
4 Subject: dmaengine: milbeaut-xdmac: Fix a resource leak in the error handling path of the probe function
5
6 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
7
8 commit d645148cc82ca7fbacaa601414a552184e9c6dd3 upstream.
9
10 'disable_xdmac()' should be called in the error handling path of the
11 probe function to undo a previous 'enable_xdmac()' call, as already
12 done in the remove function.
13
14 Fixes: a6e9be055d47 ("dmaengine: milbeaut-xdmac: Add XDMAC driver for Milbeaut platforms")
15 Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
16 Link: https://lore.kernel.org/r/20201219132800.183254-1-christophe.jaillet@wanadoo.fr
17 Signed-off-by: Vinod Koul <vkoul@kernel.org>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20 ---
21 drivers/dma/milbeaut-xdmac.c | 4 +++-
22 1 file changed, 3 insertions(+), 1 deletion(-)
23
24 --- a/drivers/dma/milbeaut-xdmac.c
25 +++ b/drivers/dma/milbeaut-xdmac.c
26 @@ -351,7 +351,7 @@ static int milbeaut_xdmac_probe(struct p
27
28 ret = dma_async_device_register(ddev);
29 if (ret)
30 - return ret;
31 + goto disable_xdmac;
32
33 ret = of_dma_controller_register(dev->of_node,
34 of_dma_simple_xlate, mdev);
35 @@ -364,6 +364,8 @@ static int milbeaut_xdmac_probe(struct p
36
37 unregister_dmac:
38 dma_async_device_unregister(ddev);
39 +disable_xdmac:
40 + disable_xdmac(mdev);
41 return ret;
42 }
43