Oldřich Jedlička 5e9aae9ef0 kernel: Fix off-by-one error in FIT mtd partition search.
This fixes off-by-one error introduced in commit dc76900021b8
("kernel: Correctly search for the FIT image in mtd partition.")

Function `mtd_read` starts reading at `offset` and
needs `hdr_len` number of bytes to be available. Suppose
the easiest case when `offset` is `0` and `hdr_len` equals
to `mtd->size` - the `for` loop will not be entered even
when enough bytes are available to be read.

Same happens for any non-zero `offset`, when `hdr_len` is
just enough bytes to be read until `mtd->size` is reached.
Imagine that for example `mtd->size=5`, `offset=4` and
`hdr_len=1`. Then `offset+hdr_len=5` and the check has to
be `offset+hdr_len <= mtd->size`, i.e. `5 <= 5`. The
check for `offset + hdr_len` value needs to be inclusive,
therefore use `<=`.

Fixes: dc76900021b8 ("kernel: Correctly search for the FIT image in mtd partition.")
Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
[adjusted commit ref, fixes tag]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit e0ce80d42ace6feba509da16795ab0eb81cf5bf4)
2019-10-09 21:05:08 +02:00
..
2019-10-08 12:45:13 +02:00
2019-10-08 12:45:13 +02:00
2019-05-11 17:15:41 +02:00
2019-10-08 12:45:13 +02:00
2019-10-08 12:45:13 +02:00
2019-10-08 12:45:13 +02:00
2019-09-20 15:52:25 +02:00
2019-10-08 12:45:13 +02:00
2019-10-08 12:45:13 +02:00
2019-10-08 12:45:13 +02:00
2019-10-08 12:45:13 +02:00
2019-10-08 12:45:13 +02:00
2019-10-08 12:45:13 +02:00
2019-09-20 15:52:25 +02:00
2019-10-08 12:45:13 +02:00
2019-10-08 12:45:13 +02:00
2019-09-20 15:52:25 +02:00
2019-10-08 12:45:13 +02:00
2019-03-11 19:35:43 +01:00
2019-10-08 12:45:13 +02:00
2019-05-11 17:15:41 +02:00
2019-06-20 15:50:00 +02:00
2019-01-07 17:09:06 +01:00
2019-10-08 12:45:13 +02:00
2018-12-10 11:48:44 +01:00
2019-10-08 12:45:13 +02:00
2019-10-08 12:45:13 +02:00
2019-05-11 17:15:41 +02:00
2019-10-08 12:45:13 +02:00