linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soc: samsung: exynos-asv: Potential NULL dereference in exynos_asv_update_opps()
@ 2019-10-29 18:27 Dan Carpenter
  2019-10-30 18:05 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-10-29 18:27 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: linux-samsung-soc, kernel-janitors, linux-kernel,
	Krzysztof Kozlowski, Sylwester Nawrocki, linux-arm-kernel

The dev_pm_opp_get_opp_table() returns error pointers if it's disabled
in the config and it returns NULL if there is an error.  This code only
checks for error pointers so it could lead to an Oops inside the
dev_pm_opp_put_opp_table() function.

Fixes: 5ea428595cc5 ("soc: samsung: Add Exynos Adaptive Supply Voltage driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
When we add a new driver, could we specify the which prefix will be used
going forward?  In other words commit 5ea428595cc5 could have the
prefix "soc: samsung: exynos-asv: Add Exynos Adaptive Supply Voltage
driver".  The "exynos-asv" bit was missing so the first person to send a
fix has to guess what is desired.

 drivers/soc/samsung/exynos-asv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/samsung/exynos-asv.c b/drivers/soc/samsung/exynos-asv.c
index 8abf4dfaa5c5..30bb7b7cc769 100644
--- a/drivers/soc/samsung/exynos-asv.c
+++ b/drivers/soc/samsung/exynos-asv.c
@@ -93,7 +93,7 @@ static int exynos_asv_update_opps(struct exynos_asv *asv)
 			continue;
 
 		opp_table = dev_pm_opp_get_opp_table(cpu);
-		if (IS_ERR(opp_table))
+		if (IS_ERR_OR_NULL(opp_table))
 			continue;
 
 		if (!last_opp_table || opp_table != last_opp_table) {
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] soc: samsung: exynos-asv: Potential NULL dereference in exynos_asv_update_opps()
  2019-10-29 18:27 [PATCH] soc: samsung: exynos-asv: Potential NULL dereference in exynos_asv_update_opps() Dan Carpenter
@ 2019-10-30 18:05 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2019-10-30 18:05 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: linux-samsung-soc, kernel-janitors, linux-kernel, Kukjin Kim,
	Sylwester Nawrocki, linux-arm-kernel

On Tue, Oct 29, 2019 at 09:27:42PM +0300, Dan Carpenter wrote:
> The dev_pm_opp_get_opp_table() returns error pointers if it's disabled
> in the config and it returns NULL if there is an error.  This code only
> checks for error pointers so it could lead to an Oops inside the
> dev_pm_opp_put_opp_table() function.
> 
> Fixes: 5ea428595cc5 ("soc: samsung: Add Exynos Adaptive Supply Voltage driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> When we add a new driver, could we specify the which prefix will be used
> going forward?  In other words commit 5ea428595cc5 could have the
> prefix "soc: samsung: exynos-asv: Add Exynos Adaptive Supply Voltage
> driver".  The "exynos-asv" bit was missing so the first person to send a
> fix has to guess what is desired.

Indeed, I usually do not add it on first commit to avoid duplication
(prefix and later explanation) but I see that it would be helpful.


Thanks, applied.

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-30 18:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-29 18:27 [PATCH] soc: samsung: exynos-asv: Potential NULL dereference in exynos_asv_update_opps() Dan Carpenter
2019-10-30 18:05 ` Krzysztof Kozlowski

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).