Re: [PATCH v3 3/3] thermal: qcom: tsens-v1: Free memory in calibrate_v1 where required

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

 



On Sat, Oct 5, 2019 at 4:11 PM <kholk11@xxxxxxxxx> wrote:
>
> From: AngeloGioacchino Del Regno <kholk11@xxxxxxxxx>
>
> The calibrate_v1 function allocates the qfprom_cdata variable
> during qfprom_read, but it never gets freed: properly kfree it.

This has already been fixed upstream. So this patch isn't required.

> Signed-off-by: AngeloGioacchino Del Regno <kholk11@xxxxxxxxx>
> ---
>  drivers/thermal/qcom/tsens-v1.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/qcom/tsens-v1.c b/drivers/thermal/qcom/tsens-v1.c
> index 3c85a698123a..017501f37a41 100644
> --- a/drivers/thermal/qcom/tsens-v1.c
> +++ b/drivers/thermal/qcom/tsens-v1.c
> @@ -173,8 +173,10 @@ static int calibrate_v1(struct tsens_priv *priv)
>         int i;
>
>         qfprom_cdata = (u32 *)qfprom_read(priv->dev, "calib");
> -       if (IS_ERR(qfprom_cdata))
> +       if (IS_ERR(qfprom_cdata)) {
> +               kfree(qfprom_cdata);
>                 return PTR_ERR(qfprom_cdata);
> +       }
>
>         mode = (qfprom_cdata[4] & CAL_SEL_MASK) >> CAL_SEL_SHIFT;
>         dev_dbg(priv->dev, "calibration mode is %d\n", mode);
> @@ -225,6 +227,7 @@ static int calibrate_v1(struct tsens_priv *priv)
>         }
>
>         compute_intercept_slope(priv, p1, p2, mode);
> +       kfree(qfprom_cdata);
>
>         return 0;
>  }
> --
> 2.21.0
>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux