u-boot/fs/ubifs
Lars Poeschel 349a8d5e56 ubifs bad superblock bug
This patch fixes an issue when ubifs reads a bad superblock. Later it
tries to free memory, that was not allocated, which freezes u-boot.
This is fixed by looking for a non null pointer before free.

The message I got before u-boot freezes:
UBI: max/mean erase counter: 53/32
UBIFS: mounted UBI device 0, volume 1, name "rootfs"
UBIFS: mounted read-only
UBIFS: file system size:   49140 bytes (50319360 KiB, 0 MiB, 49140 LEBs)
UBIFS: journal size:       49 bytes (6838272 KiB, 0 MiB, 6678 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: LZO
UBIFS: reserved for root:  0 bytes (0 KiB)
UBIFS error (pid 0): ubifs_read_node: bad node type (255 but expected 9)
UBIFS error (pid 0): ubifs_read_node: bad node at LEB 330:13104
UBIFS error (pid 0): ubifs_iget: failed to read inode 1, error -22
Error reading superblock on volume 'ubi:rootfs'!

Signed-off-by: Lars Poeschel <larsi@wh2.tu-dresden.de>
Cc: Kyungmin Park <kmpark@infradead.org>
Signed-off-by: Stefan Roese <sr@denx.de>
2011-10-12 11:33:17 +02:00
..
budget.c UBIFS: Implement read-only UBIFS support in U-Boot 2009-03-20 22:39:15 +01:00
crc16.c UBIFS: Implement read-only UBIFS support in U-Boot 2009-03-20 22:39:15 +01:00
crc16.h Update CHANGELOG, coding style cleanup. 2009-04-05 00:27:57 +02:00
debug.c UBIFS: Implement read-only UBIFS support in U-Boot 2009-03-20 22:39:15 +01:00
debug.h UBIFS: Implement read-only UBIFS support in U-Boot 2009-03-20 22:39:15 +01:00
io.c UBIFS: Implement read-only UBIFS support in U-Boot 2009-03-20 22:39:15 +01:00
key.h UBIFS: Implement read-only UBIFS support in U-Boot 2009-03-20 22:39:15 +01:00
log.c UBIFS: Implement read-only UBIFS support in U-Boot 2009-03-20 22:39:15 +01:00
lprops.c UBIFS: Implement read-only UBIFS support in U-Boot 2009-03-20 22:39:15 +01:00
lpt_commit.c UBIFS: Implement read-only UBIFS support in U-Boot 2009-03-20 22:39:15 +01:00
lpt.c UBIFS: Implement read-only UBIFS support in U-Boot 2009-03-20 22:39:15 +01:00
Makefile Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
master.c UBIFS: Implement read-only UBIFS support in U-Boot 2009-03-20 22:39:15 +01:00
misc.h UBIFS: Fix dereferencing type-punned pointer compiler warning 2011-01-11 11:09:36 +01:00
orphan.c UBIFS: Implement read-only UBIFS support in U-Boot 2009-03-20 22:39:15 +01:00
recovery.c UBIFS: fix recovery bug 2009-04-28 00:36:21 +02:00
replay.c UBIFS: Implement read-only UBIFS support in U-Boot 2009-03-20 22:39:15 +01:00
sb.c UBIFS: add R/O compatibility 2009-04-04 22:44:22 +02:00
scan.c UBIFS: Implement read-only UBIFS support in U-Boot 2009-03-20 22:39:15 +01:00
super.c ubifs bad superblock bug 2011-10-12 11:33:17 +02:00
tnc_misc.c UBIFS: Implement read-only UBIFS support in U-Boot 2009-03-20 22:39:15 +01:00
tnc.c UBIFS: Implement read-only UBIFS support in U-Boot 2009-03-20 22:39:15 +01:00
ubifs-media.h UBIFS: add R/O compatibility 2009-04-04 22:44:22 +02:00
ubifs.c UBIFS: fix warning: format '%lX' expects type 'long unsigned int' 2011-09-10 01:10:32 +02:00
ubifs.h move prototypes for gunzip() and zunzip() to common.h 2009-12-21 21:39:59 +01:00