linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: l.stach@pengutronix.de (Lucas Stach)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] cpufreq: imx6q: Fix wrong device in devm_kzalloc
Date: Wed, 28 Oct 2015 09:49:09 +0100	[thread overview]
Message-ID: <1446022149.3138.5.camel@pengutronix.de> (raw)
In-Reply-To: <1446019154-16384-3-git-send-email-s.hauer@pengutronix.de>

Am Mittwoch, den 28.10.2015, 08:59 +0100 schrieb Sascha Hauer:
> devm_kzalloc must be called with the device that is actually probed,
> not with cpu_dev which resources are not freed when probe fails.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

I think I've said this already on the last round,

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
>  drivers/cpufreq/imx6q-cpufreq.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
> index fabd144..6fefd19 100644
> --- a/drivers/cpufreq/imx6q-cpufreq.c
> +++ b/drivers/cpufreq/imx6q-cpufreq.c
> @@ -260,7 +260,8 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
>  	}
>  
>  	/* Make imx6_soc_volt array's size same as arm opp number */
> -	imx6_soc_volt = devm_kzalloc(cpu_dev, sizeof(*imx6_soc_volt) * num, GFP_KERNEL);
> +	imx6_soc_volt = devm_kzalloc(&pdev->dev,
> +				     sizeof(*imx6_soc_volt) * num, GFP_KERNEL);
>  	if (imx6_soc_volt == NULL) {
>  		ret = -ENOMEM;
>  		goto free_freq_table;

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |

  reply	other threads:[~2015-10-28  8:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-28  7:59 [PATCH v2] cpufreq: i.MX6: -EPROBE_DEFER fixes Sascha Hauer
2015-10-28  7:59 ` [PATCH 1/5] cpufreq: imx6q: Fix goto wrong error label Sascha Hauer
2015-10-28  7:59 ` [PATCH 2/5] cpufreq: imx6q: Fix wrong device in devm_kzalloc Sascha Hauer
2015-10-28  8:49   ` Lucas Stach [this message]
2015-10-28  7:59 ` [PATCH 3/5] cpufreq: imx6q: Fix regulator/clock error handling Sascha Hauer
2015-10-28  8:51   ` Lucas Stach
2015-10-28  7:59 ` [PATCH 4/5] cpufreq: imx6q: Use id_table to distinguish between SoCs Sascha Hauer
2015-10-28  9:00   ` Lucas Stach
2015-12-14  1:30   ` Shawn Guo
2015-10-28  7:59 ` [PATCH 5/5] cpufreq: imx6q: pu regulator is not optional Sascha Hauer
2015-12-11 17:23 ` [PATCH v2] cpufreq: i.MX6: -EPROBE_DEFER fixes Lucas Stach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1446022149.3138.5.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).