Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27805
b: refs/heads/master
c: 6c8b44a
h: refs/heads/master
i:
  27803: 3e1abe6
v: v3
  • Loading branch information
Andrew Morton authored and David Woodhouse committed May 20, 2006
1 parent 32419fb commit f1f33cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5fc3dbc418e01345e25e96b3192a1c46051c3fdc
refs/heads/master: 6c8b44abc86a3e23dd1a22c0ee187f06bd7c7f5d
8 changes: 6 additions & 2 deletions trunk/drivers/mtd/mtdconcat.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/concat.h>

#include <asm/div64.h>

/*
* Our storage structure:
* Subdev points to an array of pointers to struct mtd_info objects
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f1f33cb

Please sign in to comment.