UBI: fix signed-unsigned multiplication
authorBrijesh Singh <brijesh.s.singh@gmail.com>
Thu, 5 Jul 2007 09:37:35 +0000 (15:07 +0530)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Wed, 18 Jul 2007 13:57:34 +0000 (16:57 +0300)
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@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
drivers/mtd/ubi/io.c

index 20e297ad7f6b232d9ca1e47dbf8119d0e7fdfbe7..81008ab5d79342d8a911f988ac2f2ea2ef531402 100644 (file)
@@ -298,7 +298,7 @@ retry:
        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;