summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorJubin Zhong <zhongjubin@huawei.com>2020-12-19 20:49:10 +0800
committerRichard Weinberger <richard@nod.at>2021-02-12 21:53:22 +0100
commitcf0838dfa3f9337229bbb7837c24b985539bf37d (patch)
tree47c56c0d4124326ebad3b90d6d89d5f56a66e8de /drivers/mtd
parent92bf22614b21a2706f4993b278017e437f7785b3 (diff)
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>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/io.c7
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;
}