OSDN Git Service
(root)
/
sagit-ice-cold
/
kernel_xiaomi_msm8998.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3261ebd
)
UBI: bugfix in ubi_leb_change()
author
Artem Bityutskiy
<Artem.Bityutskiy@nokia.com>
Mon, 21 May 2007 17:26:05 +0000
(20:26 +0300)
committer
Artem Bityutskiy
<Artem.Bityutskiy@nokia.com>
Wed, 18 Jul 2007 13:53:57 +0000
(16:53 +0300)
Do not call 'ubi_wl_put_peb()' if the LEB was unmapped.
Reported-by: Gabor Loki <loki@inf.u-szeged.hu>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
drivers/mtd/ubi/eba.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/ubi/eba.c
b/drivers/mtd/ubi/eba.c
index
a182015
..
0db8dc7
100644
(file)
--- a/
drivers/mtd/ubi/eba.c
+++ b/
drivers/mtd/ubi/eba.c
@@
-891,11
+891,13
@@
retry:
goto write_error;
}
- err = ubi_wl_put_peb(ubi, vol->eba_tbl[lnum], 1);
- if (err) {
- ubi_free_vid_hdr(ubi, vid_hdr);
- leb_write_unlock(ubi, vol_id, lnum);
- return err;
+ if (vol->eba_tbl[lnum] >= 0) {
+ err = ubi_wl_put_peb(ubi, vol->eba_tbl[lnum], 1);
+ if (err) {
+ ubi_free_vid_hdr(ubi, vid_hdr);
+ leb_write_unlock(ubi, vol_id, lnum);
+ return err;
+ }
}
vol->eba_tbl[lnum] = pnum;