summaryrefslogtreecommitdiff
path: root/drivers/mtd/ubi
diff options
context:
space:
mode:
authorKyungmin Park <kmpark@infradead.org>2008-05-21 15:34:56 +0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-07-24 14:32:54 +0400
commita0fd1efd488092951f310fdb777b8a540cf84dcb (patch)
treed085115d57460e5ac29cdb61bf78fab9c1d3628d /drivers/mtd/ubi
parentbeeea636030622f6de67d15c61f5b311a03d188c (diff)
downloadlinux-a0fd1efd488092951f310fdb777b8a540cf84dcb.tar.xz
UBI: fix buffer padding
Instead of correctly pad the buffer wich we are writing to the eraseblock during update, we used weird construct: memset(buf + len, 0xFF, len - len); Fix this. Signed-off-by: Kyungmin Park <kmpark@infradead.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi')
-rw-r--r--drivers/mtd/ubi/upd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/ubi/upd.c b/drivers/mtd/ubi/upd.c
index ddaa1a56cc69..6fa1ab3f2a70 100644
--- a/drivers/mtd/ubi/upd.c
+++ b/drivers/mtd/ubi/upd.c
@@ -237,10 +237,10 @@ static int write_leb(struct ubi_device *ubi, struct ubi_volume *vol, int lnum,
int err;
if (vol->vol_type == UBI_DYNAMIC_VOLUME) {
- len = ALIGN(len, ubi->min_io_size);
- memset(buf + len, 0xFF, len - len);
+ int l = ALIGN(len, ubi->min_io_size);
- len = ubi_calc_data_len(ubi, buf, len);
+ memset(buf + len, 0xFF, l - len);
+ len = ubi_calc_data_len(ubi, buf, l);
if (len == 0) {
dbg_msg("all %d bytes contain 0xFF - skip", len);
return 0;