[PATCH 1/1] lib: rsa: remove redundant check

George McCollister george.mccollister at gmail.com
Thu Aug 20 20:30:08 CEST 2020


On Thu, Aug 20, 2020 at 1:25 PM Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> No need to check tmp is non-zero twice.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
>  lib/rsa/rsa-sign.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c
> index 40ca1e1f57..18b68e1976 100644
> --- a/lib/rsa/rsa-sign.c
> +++ b/lib/rsa/rsa-sign.c
> @@ -708,10 +708,6 @@ static int fdt_add_bignum(void *blob, int noffset, const char *prop_name,
>                 return -ENOMEM;
>         }
>         ctx = BN_CTX_new();

The intention was probably to check ctx. Maybe a copy and paste error?

> -       if (!tmp) {
> -               fprintf(stderr, "Out of memory (bignum context)\n");
> -               return -ENOMEM;
> -       }
>         BN_set_word(big2, 2L);
>         BN_set_word(big32, 32L);
>         BN_exp(big2_32, big2, big32, ctx); /* B = 2^32 */
> --
> 2.28.0
>


More information about the U-Boot mailing list