public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Signed Unsigned multiplication in io.c
@ 2007-07-05  9:37 brijesh.singh
  2007-07-05 10:42 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: brijesh.singh @ 2007-07-05  9:37 UTC (permalink / raw)
  To: linux-mtd

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>

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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Signed Unsigned multiplication in io.c
  2007-07-05  9:37 Signed Unsigned multiplication in io.c brijesh.singh
@ 2007-07-05 10:42 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2007-07-05 10:42 UTC (permalink / raw)
  To: brijesh.singh; +Cc: linux-mtd

On Thu, 2007-07-05 at 15:07 +0530, brijesh.singh@calsoftinc.com wrote:
> 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>

Committed, thanks.

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-05 10:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-05  9:37 Signed Unsigned multiplication in io.c brijesh.singh
2007-07-05 10:42 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox