Re: [PATCH v2 1/3] crypto: caam: ctrl: Fix the error handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 21, 2015 at 1:16 PM, Fabio Estevam <festevam@xxxxxxxxx> wrote:
> From: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
>
> In the error path we should disable the resources that were previously
> acquired, so fix the error handling accordingly.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
> ---
> Changes since v1:
> - None
>
>  drivers/crypto/caam/ctrl.c | 35 ++++++++++++++++++++++++-----------
>  1 file changed, 24 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
> index 81b552d..9c5ca46 100644
> --- a/drivers/crypto/caam/ctrl.c
> +++ b/drivers/crypto/caam/ctrl.c
> @@ -474,27 +474,27 @@ static int caam_probe(struct platform_device *pdev)
>         ret = clk_prepare_enable(ctrlpriv->caam_ipg);
>         if (ret < 0) {
>                 dev_err(&pdev->dev, "can't enable CAAM ipg clock: %d\n", ret);
> -               return -ENODEV;
> +               return ret;
>         }
>
>         ret = clk_prepare_enable(ctrlpriv->caam_mem);
>         if (ret < 0) {
>                 dev_err(&pdev->dev, "can't enable CAAM secure mem clock: %d\n",
>                         ret);
> -               return -ENODEV;
> +               goto disable_caam_ipg;
>         }
>
>         ret = clk_prepare_enable(ctrlpriv->caam_aclk);
>         if (ret < 0) {
>                 dev_err(&pdev->dev, "can't enable CAAM aclk clock: %d\n", ret);
> -               return -ENODEV;
> +               goto disable_caam_mem;
>         }
>
>         ret = clk_prepare_enable(ctrlpriv->caam_emi_slow);
>         if (ret < 0) {
>                 dev_err(&pdev->dev, "can't enable CAAM emi slow clock: %d\n",
>                         ret);
> -               return -ENODEV;
> +               goto disable_caam_aclk;
>         }
>
>         /* Get configuration properties from device tree */
> @@ -502,7 +502,7 @@ static int caam_probe(struct platform_device *pdev)
>         ctrl = of_iomap(nprop, 0);
>         if (ctrl == NULL) {
>                 dev_err(dev, "caam: of_iomap() failed\n");
> -               return -ENOMEM;
> +               goto disable_caam_emi_slow;

Ops, I missed a 'ret = -ENOMEM' here.

Will send a v3.
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux