diff options
author | Jubin Zhong <zhongjubin@huawei.com> | 2020-12-19 15:49:10 +0300 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2021-02-12 23:53:22 +0300 |
commit | cf0838dfa3f9337229bbb7837c24b985539bf37d (patch) | |
tree | 47c56c0d4124326ebad3b90d6d89d5f56a66e8de | |
parent | 92bf22614b21a2706f4993b278017e437f7785b3 (diff) | |
download | linux-cf0838dfa3f9337229bbb7837c24b985539bf37d.tar.xz |
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>
-rw-r--r-- | drivers/mtd/ubi/io.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index 2f3312c31e51..8a7306cc1947 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; } |