diff options
author | Andrew Goodbody <andrew.goodbody@linaro.org> | 2025-08-01 12:49:48 +0100 |
---|---|---|
committer | Heiko Schocher <hs@nabladev.com> | 2025-10-08 11:34:12 +0200 |
commit | 75b7ef1caf19d467ee8a7e69eb5eccb6a45e1715 (patch) | |
tree | cb4a23ba53b44d2e084480e0aadb7bcb2ba1fb48 | |
parent | 92dcb3ad5d98f494b2448a7345e1cb7eefa50278 (diff) |
mtd: ubi: Remove test that always fails
When checking the VID header of a static volume there is an early test
for data_size == 0 so testing for that condition again is guaranteed to
fail. Just remove this piece of code.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
-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 45699b4a477..2ec968c85ff 100644 --- a/drivers/mtd/ubi/io.c +++ b/drivers/mtd/ubi/io.c @@ -936,12 +936,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; } |