[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220406113143.10699-1-xiam0nd.tong@gmail.com>
Date: Wed, 6 Apr 2022 19:31:43 +0800
From: Xiaomeng Tong <xiam0nd.tong@...il.com>
To: patrik.r.jakobsson@...il.com, airlied@...ux.ie, daniel@...ll.ch
Cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
Xiaomeng Tong <xiam0nd.tong@...il.com>
Subject: [PATCH v2] drm/gma500: fix a potential repeat execution in psb_driver_load
Instead of exiting the loop as expected when an entry is found, the
list_for_each_entry() continues until the traversal is complete. To
avoid potential executing 'ret = gma_backlight_init(dev);' repeatly,
goto outside the loop when the entry is found.
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@...il.com>
---
changes since v1:
- goto outside the loop (Xiaomeng Tong)
v1: https://lore.kernel.org/lkml/20220401115811.9656-1-xiam0nd.tong@gmail.com/
---
drivers/gpu/drm/gma500/psb_drv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index 2aff54d505e2..929fd47548b4 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
+++ b/drivers/gpu/drm/gma500/psb_drv.c
@@ -400,9 +400,10 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
case INTEL_OUTPUT_LVDS:
case INTEL_OUTPUT_MIPI:
ret = gma_backlight_init(dev);
- break;
+ goto out;
}
}
+out:
drm_connector_list_iter_end(&conn_iter);
if (ret)
--
2.17.1
Powered by blists - more mailing lists