[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220401115811.9656-1-xiam0nd.tong@gmail.com>
Date: Fri, 1 Apr 2022 19:58:11 +0800
From: Xiaomeng Tong <xiam0nd.tong@...il.com>
To: patrik.r.jakobsson@...il.com
Cc: airlied@...ux.ie, daniel@...ll.ch, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org,
Xiaomeng Tong <xiam0nd.tong@...il.com>
Subject: [PATCH] drm/gma500: fix a missing break 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,
break the loop when the entry is found.
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@...il.com>
---
drivers/gpu/drm/gma500/psb_drv.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index 2aff54d505e2..b61a8b0eea38 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
+++ b/drivers/gpu/drm/gma500/psb_drv.c
@@ -402,6 +402,9 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
ret = gma_backlight_init(dev);
break;
}
+
+ if (!ret)
+ break;
}
drm_connector_list_iter_end(&conn_iter);
--
2.17.1
Powered by blists - more mailing lists