]> git.baikalelectronics.ru Git - kernel.git/commit
UBI: Fix crash in try_recover_peb()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Thu, 13 Oct 2016 14:05:36 +0000 (16:05 +0200)
committerRichard Weinberger <richard@nod.at>
Wed, 19 Oct 2016 22:06:06 +0000 (00:06 +0200)
commit5d74ba36bc701adb20f0a5a4a4da526fc7271c9d
tree1cc3f6042d9626a668b3f4658ec405c6c540b6eb
parente004a4944242d9925758ab8d7221861be50df641
UBI: Fix crash in try_recover_peb()

    drivers/mtd/ubi/eba.c: In function ‘try_recover_peb’:
    drivers/mtd/ubi/eba.c:744: warning: ‘vid_hdr’ is used uninitialized in this function

The pointer vid_hdr is indeed not initialized, leading to a crash when
it is dereferenced.

Fix this by obtaining the pointer from the VID buffer, like is done
everywhere else.

Fixes: dd42b71695e648eb ("UBI: introduce the VID buffer concept")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/ubi/eba.c