diff mbox

cpufreq: exynos: Fix for memory leak in case SoC name does not match

Message ID 04f401d0ce89$81073900$8315ab00$@kernel.org (mailing list archive)
State New, archived
Headers show

Commit Message

kgene@kernel.org Aug. 4, 2015, 7:45 a.m. UTC
From: Shailendra Verma <shailendra.capricorn@gmail.com>

During probe free the memory allocated to "exynos_info" in case of
unknown SoC type.

Signed-off-by: Shailendra Verma <shailendra.capricorn@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
[k.kozlowski: Rebased the patch around if(of_machine_is_compatible)]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Kukjin Kim <kgene@kernel.org>
---
Hi Rafael and Viresh,

Since this is a fix to prevent memory leak, it would be better if
this could be sent to linus during -rc via cpufreq tree.

Thanks,
Kukjin

 drivers/cpufreq/exynos-cpufreq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Rafael J. Wysocki Aug. 6, 2015, 12:23 a.m. UTC | #1
On Tuesday, August 04, 2015 04:45:16 PM Kukjin Kim wrote:
> From: Shailendra Verma <shailendra.capricorn@gmail.com>
> 
> During probe free the memory allocated to "exynos_info" in case of
> unknown SoC type.
> 
> Signed-off-by: Shailendra Verma <shailendra.capricorn@gmail.com>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
> [k.kozlowski: Rebased the patch around if(of_machine_is_compatible)]
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Signed-off-by: Kukjin Kim <kgene@kernel.org>
> ---
> Hi Rafael and Viresh,
> 
> Since this is a fix to prevent memory leak, it would be better if
> this could be sent to linus during -rc via cpufreq tree.

I'm not planning more pull requests for 4.2 and this one doesn't seem to be
a good enough reason for a pull request of its own, though.

Of course, if there are more urgent fixes, I can push it along with them,
but there are none so far.

Thanks,
Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Krzysztof Kozlowski Aug. 8, 2015, 7:36 a.m. UTC | #2
W dniu 06.08.2015 o 09:23, Rafael J. Wysocki pisze:
> On Tuesday, August 04, 2015 04:45:16 PM Kukjin Kim wrote:
>> From: Shailendra Verma <shailendra.capricorn@gmail.com>
>>
>> During probe free the memory allocated to "exynos_info" in case of
>> unknown SoC type.
>>
>> Signed-off-by: Shailendra Verma <shailendra.capricorn@gmail.com>
>> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
>> [k.kozlowski: Rebased the patch around if(of_machine_is_compatible)]
>> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
>> Signed-off-by: Kukjin Kim <kgene@kernel.org>
>> ---
>> Hi Rafael and Viresh,
>>
>> Since this is a fix to prevent memory leak, it would be better if
>> this could be sent to linus during -rc via cpufreq tree.
> 
> I'm not planning more pull requests for 4.2 and this one doesn't seem to be
> a good enough reason for a pull request of its own, though.
> 
> Of course, if there are more urgent fixes, I can push it along with them,
> but there are none so far.

The cpufreq driver will be removed completely in v4.3 or v4.4 with
patchset adding cpufreq-dt support for Exynos 4x12. This means that this
patch makes sense only for 4.2 and as a stable backport (but it was not
marked as such).

Anyone thinks that the patch will be worth stable back-porting?

Best regards,
Krzysztof

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Viresh Kumar Aug. 8, 2015, 1:29 p.m. UTC | #3
On 08-08-15, 16:36, Krzysztof Kozlowski wrote:
> The cpufreq driver will be removed completely in v4.3 or v4.4 with
> patchset adding cpufreq-dt support for Exynos 4x12. This means that this
> patch makes sense only for 4.2 and as a stable backport (but it was not
> marked as such).
> 
> Anyone thinks that the patch will be worth stable back-porting?

Doesn't look worth enough to me..
kgene@kernel.org Aug. 14, 2015, 9:34 a.m. UTC | #4
Rafael J. Wysocki wrote:
> 
> On Saturday, August 08, 2015 04:36:34 PM Krzysztof Kozlowski wrote:
> > W dniu 06.08.2015 o 09:23, Rafael J. Wysocki pisze:
> > > On Tuesday, August 04, 2015 04:45:16 PM Kukjin Kim wrote:
> > >> From: Shailendra Verma <shailendra.capricorn@gmail.com>
> > >>
> > >> During probe free the memory allocated to "exynos_info" in case of
> > >> unknown SoC type.
> > >>
> > >> Signed-off-by: Shailendra Verma <shailendra.capricorn@gmail.com>
> > >> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> > >> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
> > >> [k.kozlowski: Rebased the patch around if(of_machine_is_compatible)]
> > >> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> > >> Signed-off-by: Kukjin Kim <kgene@kernel.org>
> > >> ---
> > >> Hi Rafael and Viresh,
> > >>
> > >> Since this is a fix to prevent memory leak, it would be better if
> > >> this could be sent to linus during -rc via cpufreq tree.
> > >
> > > I'm not planning more pull requests for 4.2 and this one doesn't seem to be
> > > a good enough reason for a pull request of its own, though.
> > >
> > > Of course, if there are more urgent fixes, I can push it along with them,
> > > but there are none so far.
> >
> > The cpufreq driver will be removed completely in v4.3 or v4.4 with
> > patchset adding cpufreq-dt support for Exynos 4x12. This means that this
> > patch makes sense only for 4.2 and as a stable backport (but it was not
> > marked as such).
> 
> Since I have one more ACPI fix for 4.2, I've applied this one and will
> push it to Linus next week.
> 
Rafael, thanks.

- Kukjin

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafael J. Wysocki Aug. 14, 2015, 9:41 a.m. UTC | #5
On Saturday, August 08, 2015 04:36:34 PM Krzysztof Kozlowski wrote:
> W dniu 06.08.2015 o 09:23, Rafael J. Wysocki pisze:
> > On Tuesday, August 04, 2015 04:45:16 PM Kukjin Kim wrote:
> >> From: Shailendra Verma <shailendra.capricorn@gmail.com>
> >>
> >> During probe free the memory allocated to "exynos_info" in case of
> >> unknown SoC type.
> >>
> >> Signed-off-by: Shailendra Verma <shailendra.capricorn@gmail.com>
> >> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> >> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
> >> [k.kozlowski: Rebased the patch around if(of_machine_is_compatible)]
> >> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> >> Signed-off-by: Kukjin Kim <kgene@kernel.org>
> >> ---
> >> Hi Rafael and Viresh,
> >>
> >> Since this is a fix to prevent memory leak, it would be better if
> >> this could be sent to linus during -rc via cpufreq tree.
> > 
> > I'm not planning more pull requests for 4.2 and this one doesn't seem to be
> > a good enough reason for a pull request of its own, though.
> > 
> > Of course, if there are more urgent fixes, I can push it along with them,
> > but there are none so far.
> 
> The cpufreq driver will be removed completely in v4.3 or v4.4 with
> patchset adding cpufreq-dt support for Exynos 4x12. This means that this
> patch makes sense only for 4.2 and as a stable backport (but it was not
> marked as such).

Since I have one more ACPI fix for 4.2, I've applied this one and will
push it to Linus next week.

Thanks,
Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
index ae5b2bd..fa3dd84 100644
--- a/drivers/cpufreq/exynos-cpufreq.c
+++ b/drivers/cpufreq/exynos-cpufreq.c
@@ -180,7 +180,7 @@  static int exynos_cpufreq_probe(struct platform_device *pdev)
 		ret = exynos5250_cpufreq_init(exynos_info);
 	} else {
 		pr_err("%s: Unknown SoC type\n", __func__);
-		return -ENODEV;
+		ret = -ENODEV;
 	}
 
 	if (ret)
@@ -188,12 +188,14 @@  static int exynos_cpufreq_probe(struct platform_device *pdev)
 
 	if (exynos_info->set_freq == NULL) {
 		dev_err(&pdev->dev, "No set_freq function (ERR)\n");
+		ret = -EINVAL;
 		goto err_vdd_arm;
 	}
 
 	arm_regulator = regulator_get(NULL, "vdd_arm");
 	if (IS_ERR(arm_regulator)) {
 		dev_err(&pdev->dev, "failed to get resource vdd_arm\n");
+		ret = -EINVAL;
 		goto err_vdd_arm;
 	}
 
@@ -225,7 +227,7 @@  err_cpufreq_reg:
 	regulator_put(arm_regulator);
 err_vdd_arm:
 	kfree(exynos_info);
-	return -EINVAL;
+	return ret;
 }
 
 static struct platform_driver exynos_cpufreq_platdrv = {