]>
Commit | Line | Data |
---|---|---|
7b8cad35 GKH |
1 | From a0d28ba01ebd048b4ba418142b37f5cf80e6d156 Mon Sep 17 00:00:00 2001 |
2 | From: Guennadi Liakhovetski <g.liakhovetski@gmx.de> | |
3 | Date: Tue, 23 Oct 2012 14:08:52 +0200 | |
4 | Subject: mmc: sh_mmcif: fix use after free | |
5 | ||
6 | From: Guennadi Liakhovetski <g.liakhovetski@gmx.de> | |
7 | ||
8 | commit a0d28ba01ebd048b4ba418142b37f5cf80e6d156 upstream. | |
9 | ||
10 | A recent commit "mmc: sh_mmcif: fix clock management" has introduced a | |
11 | use after free bug in sh_mmcif.c: in sh_mmcif_remove() the call to | |
12 | mmc_free_host() frees private driver data, therefore using it afterwards | |
13 | is a bug. Revert that hunk. | |
14 | ||
15 | Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> | |
16 | Signed-off-by: Chris Ball <cjb@laptop.org> | |
17 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
18 | ||
19 | --- | |
20 | drivers/mmc/host/sh_mmcif.c | 2 +- | |
21 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
22 | ||
23 | --- a/drivers/mmc/host/sh_mmcif.c | |
24 | +++ b/drivers/mmc/host/sh_mmcif.c | |
25 | @@ -1464,9 +1464,9 @@ static int __devexit sh_mmcif_remove(str | |
26 | ||
27 | platform_set_drvdata(pdev, NULL); | |
28 | ||
29 | + clk_disable(host->hclk); | |
30 | mmc_free_host(host->mmc); | |
31 | pm_runtime_put_sync(&pdev->dev); | |
32 | - clk_disable(host->hclk); | |
33 | pm_runtime_disable(&pdev->dev); | |
34 | ||
35 | return 0; |