From 5c3db30218b188198aa33b5a86b4fec1e3188737 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Thu, 8 Oct 2020 16:58:18 +1100 Subject: [PATCH 2137/2944] lib/mpi: Remove unused scalar_copied to #31026859 commit d72286943212fdb6d254d08d4cfccdc70603d0ca upstream The scalar_copied variable is not as the scalar is never copied in that block. This patch removes it. Fixes: d58bb7e55a8a ("lib/mpi: Introduce ec implementation to...") Reported-by: Gustavo A. R. Silva Signed-off-by: Herbert Xu Signed-off-by: Tianjia Zhang Reviewed-by: Jia Zhang --- lib/mpi/ec.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/mpi/ec.c b/lib/mpi/ec.c index c214701..40f5908 100644 --- a/lib/mpi/ec.c +++ b/lib/mpi/ec.c @@ -1252,7 +1252,6 @@ void mpi_ec_mul_point(MPI_POINT result, MPI_POINT q1, q2, prd, sum; unsigned long sw; mpi_size_t rsize; - int scalar_copied = 0; /* Compute scalar point multiplication with Montgomery Ladder. * Note that we don't use Y-coordinate in the points at all. @@ -1314,8 +1313,6 @@ void mpi_ec_mul_point(MPI_POINT result, point_free(&p2); point_free(&p1_); point_free(&p2_); - if (scalar_copied) - mpi_free(scalar); return; } -- 1.8.3.1