]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.6.7/mmc-sh_mmcif-fix-use-after-free.patch
Linux 3.6.7
[thirdparty/kernel/stable-queue.git] / releases / 3.6.7 / mmc-sh_mmcif-fix-use-after-free.patch
CommitLineData
7b8cad35
GKH
1From a0d28ba01ebd048b4ba418142b37f5cf80e6d156 Mon Sep 17 00:00:00 2001
2From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
3Date: Tue, 23 Oct 2012 14:08:52 +0200
4Subject: mmc: sh_mmcif: fix use after free
5
6From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
7
8commit a0d28ba01ebd048b4ba418142b37f5cf80e6d156 upstream.
9
10A recent commit "mmc: sh_mmcif: fix clock management" has introduced a
11use after free bug in sh_mmcif.c: in sh_mmcif_remove() the call to
12mmc_free_host() frees private driver data, therefore using it afterwards
13is a bug. Revert that hunk.
14
15Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
16Signed-off-by: Chris Ball <cjb@laptop.org>
17Signed-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;