From ca86ced287fef279735e9632a3be39605f34bc93 Mon Sep 17 00:00:00 2001 From: xbw Date: Sun, 25 Mar 2012 14:06:15 +0800 Subject: [PATCH] mmc; fix the kernel crasht for th he bug in rk29_sdmmc_progress_store() --- drivers/mmc/host/rk29_sdmmc.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/host/rk29_sdmmc.c b/drivers/mmc/host/rk29_sdmmc.c index 722caac23c3d..785f092e1c4d 100755 --- a/drivers/mmc/host/rk29_sdmmc.c +++ b/drivers/mmc/host/rk29_sdmmc.c @@ -299,8 +299,6 @@ ssize_t rk29_sdmmc_progress_store(struct kobject *kobj, struct kobj_attribute *a return count; } - spin_lock(&host->lock); - //envalue the address of host base on input-parameter. if( !strncmp(buf,"sd-" , strlen("sd-")) ) { @@ -308,7 +306,7 @@ ssize_t rk29_sdmmc_progress_store(struct kobject *kobj, struct kobj_attribute *a if(!host) { printk("%s..%d.. fail to call progress_store because the host is null. ==xbw==\n",__FUNCTION__,__LINE__); - goto progress_store_out; + return count; } } else if( !strncmp(buf,"sdio1-" , strlen("sdio1-")) ) @@ -317,7 +315,7 @@ ssize_t rk29_sdmmc_progress_store(struct kobject *kobj, struct kobj_attribute *a if(!host) { printk("%s..%d.. fail to call progress_store because the host-sdio1 is null. ==xbw==\n",__FUNCTION__,__LINE__); - goto progress_store_out; + return count; } } else if( !strncmp(buf,"sdio2-" , strlen("sdio2-")) ) @@ -326,15 +324,17 @@ ssize_t rk29_sdmmc_progress_store(struct kobject *kobj, struct kobj_attribute *a if(!host) { printk("%s..%d.. fail to call progress_store because the host-sdio2 is null. ==xbw==\n",__FUNCTION__,__LINE__); - goto progress_store_out; + return count; } } else { printk("%s..%d.. You want to use sysfs for SDMMC but input-parameter is wrong.====xbw====\n",__FUNCTION__,__LINE__); - goto progress_store_out;//return count; + return count; } + spin_lock(&host->lock); + if(strncmp(buf,oldbuf , strlen(buf))) { printk(".%d.. MMC0 receive the message %s from VOLD.====xbw[%s]====\n", __LINE__, buf, host->dma_name); @@ -458,7 +458,6 @@ ssize_t rk29_sdmmc_progress_store(struct kobject *kobj, struct kobj_attribute *a } } -progress_store_out: spin_unlock(&host->lock); return count; -- 2.34.1