mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
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: 3291b52f9f ("UBI: introduce the VID buffer concept")
Signed-off-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
This commit is contained in:
parent
a15cf34fed
commit
884a3b6478
1 changed files with 1 additions and 0 deletions
|
|
@ -741,6 +741,7 @@ static int try_recover_peb(struct ubi_volume *vol, int pnum, int lnum,
|
|||
goto out_put;
|
||||
}
|
||||
|
||||
vid_hdr = ubi_get_vid_hdr(vidb);
|
||||
ubi_assert(vid_hdr->vol_type == UBI_VID_DYNAMIC);
|
||||
|
||||
mutex_lock(&ubi->buf_mutex);
|
||||
|
|
|
|||
Loading…
Reference in a new issue