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>
This commit is contained in:
Andrew Goodbody
2025-08-01 12:49:48 +01:00
committed by Heiko Schocher
parent 92dcb3ad5d
commit 75b7ef1caf

View File

@@ -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;
}