提交 06fb220b 编写于 作者: L Laurent Pinchart 提交者: Rob Clark

drm/omap: Don't dereference list head when the connectors list is empty

The connectors list iterator returns the list head when the list is
empty. Fix it by returning NULL in that case.
Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: NRob Clark <robdclark@gmail.com>
Signed-off-by: NRob Clark <robdclark@gmail.com>
上级 30b6f8f6
......@@ -306,7 +306,8 @@ struct drm_connector *omap_framebuffer_get_next_connector(
struct drm_connector *connector = from;
if (!from)
return list_first_entry(connector_list, typeof(*from), head);
return list_first_entry_or_null(connector_list, typeof(*from),
head);
list_for_each_entry_from(connector, connector_list, head) {
if (connector != from) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册