diff options
author | Tom Zhu <a2289c@android-hal-04.(none)> | 2009-09-24 10:58:50 -0500 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-06-14 09:09:19 -0700 |
commit | 310cd14451caec695f8df1d07ecb7943f59f8064 (patch) | |
tree | fd671682b258197039366a34cd6ca66e8501a352 /drivers/misc | |
parent | d2e9d64b77d4aaedee9fd273bf66448a21fc45ba (diff) |
misc: apanic: erase kpanic when no data
erase kpanic partition when there is no data(console and thread)
Signed-off-by: Tom Zhu <a2289c@android-hal-04.(none)>
Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/apanic.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/misc/apanic.c b/drivers/misc/apanic.c index f50881ba917d..ca875f89da7a 100644 --- a/drivers/misc/apanic.c +++ b/drivers/misc/apanic.c @@ -297,6 +297,7 @@ static void mtd_panic_notify_add(struct mtd_info *mtd) struct panic_header *hdr = ctx->bounce; size_t len; int rc; + int proc_entry_created = 0; if (strcmp(mtd->name, CONFIG_APANIC_PLABEL)) return; @@ -358,6 +359,7 @@ static void mtd_panic_notify_add(struct mtd_info *mtd) ctx->apanic_console->write_proc = apanic_proc_write; ctx->apanic_console->size = hdr->console_length; ctx->apanic_console->data = (void *) 1; + proc_entry_created = 1; } } @@ -372,9 +374,13 @@ static void mtd_panic_notify_add(struct mtd_info *mtd) ctx->apanic_threads->write_proc = apanic_proc_write; ctx->apanic_threads->size = hdr->threads_length; ctx->apanic_threads->data = (void *) 2; + proc_entry_created = 1; } } + if (!proc_entry_created) + mtd_panic_erase(); + return; out_err: ctx->mtd = NULL; |