From: Viresh Kumar <viresh.kumar@linaro.org>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: linux-arm-kernel@lists.infradead.org,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
linux-pm@vger.kernel.org, Shawn Guo <shawnguo@kernel.org>,
kernel@pengutronix.de, Heiner Kallweit <hkallweit1@gmail.com>
Subject: Re: [PATCH 2/4] cpufreq: imx6q: Fix wrong device in devm_kzalloc
Date: Thu, 22 Oct 2015 18:59:01 +0530 [thread overview]
Message-ID: <20151022132901.GD3897@ubuntu> (raw)
In-Reply-To: <1445503652-777-3-git-send-email-s.hauer@pengutronix.de>
On 22-10-15, 10:47, Sascha Hauer wrote:
> 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>
> ---
> 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..7557d1e 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);
Please rewrite it as:
imx6_soc_volt = devm_kzalloc(&pdev->dev,
sizeof(*imx6_soc_volt) * num, GFP_KERNEL);
checkpatch --strict will warn against this.
--
viresh
WARNING: multiple messages have this Message-ID (diff)
From: viresh.kumar@linaro.org (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] cpufreq: imx6q: Fix wrong device in devm_kzalloc
Date: Thu, 22 Oct 2015 18:59:01 +0530 [thread overview]
Message-ID: <20151022132901.GD3897@ubuntu> (raw)
In-Reply-To: <1445503652-777-3-git-send-email-s.hauer@pengutronix.de>
On 22-10-15, 10:47, Sascha Hauer wrote:
> 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>
> ---
> 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..7557d1e 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);
Please rewrite it as:
imx6_soc_volt = devm_kzalloc(&pdev->dev,
sizeof(*imx6_soc_volt) * num, GFP_KERNEL);
checkpatch --strict will warn against this.
--
viresh
next prev parent reply other threads:[~2015-10-22 13:29 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-22 8:47 cpufreq: i.MX6: -EPROBE_DEFER fixes Sascha Hauer
2015-10-22 8:47 ` Sascha Hauer
2015-10-22 8:47 ` [PATCH 1/4] cpufreq: imx6q: Fix goto wrong error label Sascha Hauer
2015-10-22 8:47 ` Sascha Hauer
2015-10-22 10:11 ` Lucas Stach
2015-10-22 10:11 ` Lucas Stach
2015-10-22 8:47 ` [PATCH 2/4] cpufreq: imx6q: Fix wrong device in devm_kzalloc Sascha Hauer
2015-10-22 8:47 ` Sascha Hauer
2015-10-22 10:11 ` Lucas Stach
2015-10-22 10:11 ` Lucas Stach
2015-10-22 13:29 ` Viresh Kumar [this message]
2015-10-22 13:29 ` Viresh Kumar
2015-10-22 8:47 ` [PATCH 3/4] cpufreq: imx6q: Fix regulator/clock error handling Sascha Hauer
2015-10-22 8:47 ` Sascha Hauer
2015-10-22 10:18 ` Lucas Stach
2015-10-22 10:18 ` Lucas Stach
2015-10-22 13:33 ` Viresh Kumar
2015-10-22 13:33 ` Viresh Kumar
2015-10-26 7:38 ` Sascha Hauer
2015-10-26 7:38 ` Sascha Hauer
2015-10-22 8:47 ` [PATCH 4/4] cpufreq: imx6q: check regulator_get_optional return value Sascha Hauer
2015-10-22 8:47 ` Sascha Hauer
2015-10-22 10:23 ` Lucas Stach
2015-10-22 10:23 ` Lucas Stach
2015-10-26 8:17 ` Sascha Hauer
2015-10-26 8:17 ` Sascha Hauer
2015-10-28 3:27 ` cpufreq: i.MX6: -EPROBE_DEFER fixes Rafael J. Wysocki
2015-10-28 3:27 ` Rafael J. Wysocki
2015-10-28 7:59 ` Sascha Hauer
2015-10-28 7:59 ` Sascha Hauer
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=20151022132901.GD3897@ubuntu \
--to=viresh.kumar@linaro.org \
--cc=hkallweit1@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.