Signed Unsigned multiplication in io.c

brijesh.singh at calsoftinc.com brijesh.singh at calsoftinc.com
Thu Jul 5 05:37:35 EDT 2007


There is signed multiplication assigned to unsigned ei.addr in io.c.
This causes wrong addresses for big multiplication.This patch solves the
problem.

Signed-off-by: Brijesh Singh <brijesh.s.singh at gmail.com>

Index: mtd-2.6/drivers/mtd/ubi/io.c
===================================================================
--- mtd-2.6.orig/drivers/mtd/ubi/io.c	2007-07-05 13:53:21.000000000 +0530
+++ mtd-2.6/drivers/mtd/ubi/io.c	2007-07-05 14:05:40.000000000 +0530
@@ -298,7 +298,7 @@
 	memset(&ei, 0, sizeof(struct erase_info));

 	ei.mtd      = ubi->mtd;
-	ei.addr     = pnum * ubi->peb_size;
+	ei.addr     = (loff_t)pnum * ubi->peb_size;
 	ei.len      = ubi->peb_size;
 	ei.callback = erase_callback;
 	ei.priv     = (unsigned long)&wq;





More information about the linux-mtd mailing list