Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346501
b: refs/heads/master
c: cdd9fa8
h: refs/heads/master
i:
  346499: ed70e43
v: v3
  • Loading branch information
Akinobu Mita authored and Linus Torvalds committed Dec 18, 2012
1 parent 222fb99 commit f5263d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 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: 7e45bf83f4cee68f0cfa9599007f8e089ea53365
refs/heads/master: cdd9fa8de64bc5b33d8e943dde486b60d8468ec0
8 changes: 3 additions & 5 deletions trunk/fs/ubifs/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -2560,7 +2560,7 @@ static int power_cut_emulated(struct ubifs_info *c, int lnum, int write)
static int corrupt_data(const struct ubifs_info *c, const void *buf,
unsigned int len)
{
unsigned int from, to, i, ffs = chance(1, 2);
unsigned int from, to, ffs = chance(1, 2);
unsigned char *p = (void *)buf;

from = random32() % (len + 1);
Expand All @@ -2571,11 +2571,9 @@ static int corrupt_data(const struct ubifs_info *c, const void *buf,
ffs ? "0xFFs" : "random data");

if (ffs)
for (i = from; i < to; i++)
p[i] = 0xFF;
memset(p + from, 0xFF, to - from);
else
for (i = from; i < to; i++)
p[i] = random32() % 0x100;
prandom_bytes(p + from, to - from);

return to;
}
Expand Down

0 comments on commit f5263d6

Please sign in to comment.