From 45f195b05adc0f0798f4920ee649f58b6ea99494 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 19 Nov 2008 17:11:26 +0000 Subject: s3cmci-dont-leak-pdata.patch When compiling s3cmci as a module and doing an insmod-rmmod-insmod sequence, s3cmci_probe often oopses because the platform data contains garbage. The reason for this is that I'm not providing any platform data (removed in gta02-mmc-mci.patch), and thus s3cmci tries to put its own defaults: if (!host->pdata) { pdev->dev.platform_data = &s3cmci_def_pdata; host->pdata = &s3cmci_def_pdata; } s3cmci_def_pdata is inside the module, so the pointer in pdev->dev.platform_data becomes invalid after the module is unloaded. Since nothing else in s3cmci uses pdev->dev.platform_data, "patching" it seems unnecessary. This patch removes it. Signed-off-by: Werner Almesberger --- drivers/mmc/host/s3cmci.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/mmc') diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c index 2bae68b4a92..a2bb2129bfd 100644 --- a/drivers/mmc/host/s3cmci.c +++ b/drivers/mmc/host/s3cmci.c @@ -1280,10 +1280,8 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440) host->is2440 = is2440; host->pdata = pdev->dev.platform_data; - if (!host->pdata) { - pdev->dev.platform_data = &s3cmci_def_pdata; + if (!host->pdata) host->pdata = &s3cmci_def_pdata; - } spin_lock_init(&host->complete_lock); tasklet_init(&host->pio_tasklet, pio_tasklet, (unsigned long) host); -- cgit v1.2.3