summaryrefslogtreecommitdiff
path: root/lib/bch.c
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2017-02-27 20:22:00 +0300
committerJagan Teki <jagan@amarulasolutions.com>2017-04-07 08:53:45 +0300
commitea3f750c73e3af268ab6967f95a8d0f7a22cddc5 (patch)
tree3b4439aebb898df045080094639599c6a8a611de /lib/bch.c
parent0e434ee8da819ab4c4ef11dadcb097c141bfb273 (diff)
downloadu-boot-ea3f750c73e3af268ab6967f95a8d0f7a22cddc5.tar.xz
nand: sunxi: Fix modulo by zero error
When trying to autodetect the ECC and randomization configurations, the driver starts with a randomization disabled and no seeds. In this case, the number of seeds is obviously 0, and the randomize boolean is set to false. However, the logic that retrieves the seed for a given page offset will blindly use the number of seeds, without testing if the randomization is enabled, basically doing a modulo by 0. As it turns out, the libgcc in the common toolchain returns 0 here, which was our expected value in such a case, and why we would not detect it. However, U-Boot's libgcc will for some reason return from the function instead, resulting in an error to load the U-Boot binary in the SPL. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Scott Wood <oss@buserror.net> Reviewed-by: Jagan Teki <jagan@openedev.com>
Diffstat (limited to 'lib/bch.c')
0 files changed, 0 insertions, 0 deletions