From 6ed2518050ef4ed106dd2164432169fa8032fe1f Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Mon, 21 Feb 2011 11:28:12 +0800 Subject: [PATCH] apanic: fix rknand erase --- drivers/misc/apanic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/apanic.c b/drivers/misc/apanic.c index 0eb7ed6be672..4a9f48ac7480 100644 --- a/drivers/misc/apanic.c +++ b/drivers/misc/apanic.c @@ -216,8 +216,8 @@ static void mtd_panic_erase(void) struct apanic_data *ctx = &drv_ctx; #ifdef CONFIG_MTD_RKNAND size_t wlen; - memset(ctx->bounce, 0, sizeof(struct panic_header)); - ctx->mtd->write(ctx->mtd, 0, sizeof(struct panic_header), &wlen, ctx->bounce); + memset(ctx->bounce, 0, ctx->mtd->writesize); + ctx->mtd->write(ctx->mtd, 0, ctx->mtd->writesize, &wlen, ctx->bounce); #else struct erase_info erase; DECLARE_WAITQUEUE(wait, current); -- 2.34.1