From: Jubin Zhong Date: Sat, 19 Dec 2020 12:49:10 +0000 (+0800) Subject: ubi: remove dead code in validate_vid_hdr() X-Git-Tag: v5.12-rc1~135^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cf0838dfa3f9337229bbb7837c24b985539bf37d;p=thirdparty%2Flinux.git 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 Signed-off-by: Richard Weinberger --- diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index 2f3312c31e51c..8a7306cc19471 100644 --- a/drivers/mtd/ubi/io.c +++ b/drivers/mtd/ubi/io.c @@ -913,12 +913,7 @@ static int validate_vid_hdr(const struct ubi_device *ubi, ubi_err(ubi, "bad data_size"); goto bad; } - } else if (lnum == used_ebs - 1) { - if (data_size == 0) { - ubi_err(ubi, "bad data_size at last LEB"); - goto bad; - } - } else { + } else if (lnum > used_ebs - 1) { ubi_err(ubi, "too high lnum"); goto bad; }