Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329071
b: refs/heads/master
c: d2f588f
h: refs/heads/master
i:
  329069: f6a1882
  329067: 69f1691
  329063: 310e242
  329055: 9ce0509
v: v3
  • Loading branch information
Richard Genoud authored and Artem Bityutskiy committed Sep 4, 2012
1 parent 1849e0d commit f17b299
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 256334c3191af9d9e520082db9beb75ff801d86c
refs/heads/master: d2f588f9340ed23dfb6cda08b8a1917ef3e8527c
9 changes: 9 additions & 0 deletions trunk/drivers/mtd/ubi/build.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
/* Maximum number of comma-separated items in the 'mtd=' parameter */
#define MTD_PARAM_MAX_COUNT 2

/* Maximum value for the number of bad PEBs per 1024 PEBs */
#define MAX_MTD_UBI_BEB_LIMIT 768

#ifdef CONFIG_MTD_UBI_MODULE
#define ubi_is_module() 1
#else
Expand Down Expand Up @@ -852,6 +855,12 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
struct ubi_device *ubi;
int i, err, ref = 0;

if (max_beb_per1024 < 0 || max_beb_per1024 > MAX_MTD_UBI_BEB_LIMIT)
return -EINVAL;

if (!max_beb_per1024)
max_beb_per1024 = CONFIG_MTD_UBI_BEB_LIMIT;

/*
* Check if we already have the same MTD device attached.
*
Expand Down

0 comments on commit f17b299

Please sign in to comment.