diff options
| author | Brian Norris <computersforpeace@gmail.com> | 2015-11-20 17:10:54 -0500 |
|---|---|---|
| committer | Richard Weinberger <richard@nod.at> | 2015-12-16 16:46:26 -0500 |
| commit | 2e69d4912f2fc9d4cd952311d58ceae1cd83057b (patch) | |
| tree | 76d90def57448d93bf168ebe14c454463e4cbfaa | |
| parent | 97cb69dd800a471c3ee2467be3826badd9c12883 (diff) | |
UBI: fix use of "VID" vs. "EC" in header self-check
Looks like a typo, using UBI_EC_HDR_SIZE_CRC (note the "EC") to compute
the CRC for the VID header.
This shouldn't cause any functional change, as both structures are 64
bytes. Verified with:
BUILD_BUG_ON(UBI_VID_HDR_SIZE_CRC != UBI_EC_HDR_SIZE_CRC);
Reported here:
http://lists.infradead.org/pipermail/linux-mtd/2013-September/048570.html
Reported by: Bill Pringlemeir <bpringlemeir@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
| -rw-r--r-- | drivers/mtd/ubi/io.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index 1fc23e48fe8e..10cf3b549959 100644 --- a/drivers/mtd/ubi/io.c +++ b/drivers/mtd/ubi/io.c | |||
| @@ -1299,7 +1299,7 @@ static int self_check_peb_vid_hdr(const struct ubi_device *ubi, int pnum) | |||
| 1299 | if (err && err != UBI_IO_BITFLIPS && !mtd_is_eccerr(err)) | 1299 | if (err && err != UBI_IO_BITFLIPS && !mtd_is_eccerr(err)) |
| 1300 | goto exit; | 1300 | goto exit; |
| 1301 | 1301 | ||
| 1302 | crc = crc32(UBI_CRC32_INIT, vid_hdr, UBI_EC_HDR_SIZE_CRC); | 1302 | crc = crc32(UBI_CRC32_INIT, vid_hdr, UBI_VID_HDR_SIZE_CRC); |
| 1303 | hdr_crc = be32_to_cpu(vid_hdr->hdr_crc); | 1303 | hdr_crc = be32_to_cpu(vid_hdr->hdr_crc); |
| 1304 | if (hdr_crc != crc) { | 1304 | if (hdr_crc != crc) { |
| 1305 | ubi_err(ubi, "bad VID header CRC at PEB %d, calculated %#08x, read %#08x", | 1305 | ubi_err(ubi, "bad VID header CRC at PEB %d, calculated %#08x, read %#08x", |
