Skip to contentSkip to conversation

drm/panfrost: Fix missing clk_disable_unprepare() on error in panfrost_clk_init()

PATCH In review Wei Yongjun 2 participants 2 messages Jun 8, 2021 – Jun 11, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/panfrost: Fix missing clk_disable_unprepare() on error in panfrost_clk_init()

Fix the missing clk_disable_unprepare() before return from panfrost_clk_init() in the error handling case.

Fixes b681af0bc1cc ("drm: panfrost: add optional bus_clock")
---
 drivers/gpu/drm/panfrost/panfrost_device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/panfrost/panfrost_device.c +2 -1
index 125ed973feaa..a2a09c51eed7 100644
@@ -54,7 +54,8 @@ static int panfrost_clk_init(struct panfrost_device *pfdev)
 	if (IS_ERR(pfdev->bus_clock)) {
 		dev_err(pfdev->dev, "get bus_clock failed %ld\n",
 			PTR_ERR(pfdev->bus_clock));
-		return PTR_ERR(pfdev->bus_clock);
+		err = PTR_ERR(pfdev->bus_clock);
+		goto disable_clock;
 	}
 
 	if (pfdev->bus_clock) {
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Wei Yongjun

Fix the missing clk_disable_unprepare() before return from panfrost_clk_init() in the error handling case.

Fixes b681af0bc1cc ("drm: panfrost: add optional bus_clock")

I'll push this to drm-misc-next.

Thanks,

Steve

Quoted 19 lines
---
 drivers/gpu/drm/panfrost/panfrost_device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/panfrost/panfrost_device.c +2 -1
index 125ed973feaa..a2a09c51eed7 100644
@@ -54,7 +54,8 @@ static int panfrost_clk_init(struct panfrost_device *pfdev)
 	if (IS_ERR(pfdev->bus_clock)) {
 		dev_err(pfdev->dev, "get bus_clock failed %ld\n",
 			PTR_ERR(pfdev->bus_clock));
-		return PTR_ERR(pfdev->bus_clock);
+		err = PTR_ERR(pfdev->bus_clock);
+		goto disable_clock;
 	}
 
 	if (pfdev->bus_clock) {