From f1f33cb6379ee688d1e90bb65aa203e3a5f8bb7b Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 20 May 2006 10:17:21 +0100 Subject: [PATCH] --- yaml --- r: 27805 b: refs/heads/master c: 6c8b44abc86a3e23dd1a22c0ee187f06bd7c7f5d h: refs/heads/master i: 27803: 3e1abe6a09e6e66d3f7f7027b67171f72527f8aa v: v3 --- [refs] | 2 +- trunk/drivers/mtd/mtdconcat.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 7c9543adc9de..391d84cf8c44 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5fc3dbc418e01345e25e96b3192a1c46051c3fdc +refs/heads/master: 6c8b44abc86a3e23dd1a22c0ee187f06bd7c7f5d diff --git a/trunk/drivers/mtd/mtdconcat.c b/trunk/drivers/mtd/mtdconcat.c index b7de90845c2d..3c61a980c56c 100644 --- a/trunk/drivers/mtd/mtdconcat.c +++ b/trunk/drivers/mtd/mtdconcat.c @@ -19,6 +19,8 @@ #include #include +#include + /* * Our storage structure: * Subdev points to an array of pointers to struct mtd_info objects @@ -276,9 +278,11 @@ concat_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, return -EINVAL; /* Check alignment */ - if (mtd->oobblock > 1) - if ((to % mtd->oobblock) || (total_len % mtd->oobblock)) + if (mtd->oobblock > 1) { + loff_t __to = to; + if (do_div(__to, mtd->oobblock) || (total_len % mtd->oobblock)) return -EINVAL; + } /* make a copy of vecs */ vecs_copy = kmalloc(sizeof(struct kvec) * count, GFP_KERNEL);