Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ubi: remove dead code in validate_vid_hdr()

data_size is already checked against zero when vol_type matches
UBI_VID_STATIC. Remove the following dead code.

Signed-off-by: Jubin Zhong <zhongjubin@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>

authored by

Jubin Zhong and committed by
Richard Weinberger
cf0838df 92bf2261

+1 -6
+1 -6
drivers/mtd/ubi/io.c
··· 913 913 ubi_err(ubi, "bad data_size"); 914 914 goto bad; 915 915 } 916 - } else if (lnum == used_ebs - 1) { 917 - if (data_size == 0) { 918 - ubi_err(ubi, "bad data_size at last LEB"); 919 - goto bad; 920 - } 921 - } else { 916 + } else if (lnum > used_ebs - 1) { 922 917 ubi_err(ubi, "too high lnum"); 923 918 goto bad; 924 919 }