We can't call mpi_free() on the elements if the first kzalloc() fails.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: James Morris <jmorris@namei.org>
G = kzalloc((1 << k) * sizeof *G, GFP_KERNEL);
if (!G)
- goto nomem;
+ goto err_out;
/* and calculate */
tmp = mpi_alloc(mpi_get_nlimbs(m) + 1);
for (i = 0; i < (1 << k); i++)
mpi_free(G[i]);
kfree(G);
+err_out:
return rc;
}