All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Rob Clark <robdclark@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/omap: Don't dereference list head when the connectors list is empty
Date: Fri, 28 Mar 2014 22:56:12 +0100	[thread overview]
Message-ID: <2173059.lQqA5CBIAz@avalon> (raw)
In-Reply-To: <1387886281-32483-1-git-send-email-laurent.pinchart@ideasonboard.com>

Hi Rob,

On Tuesday 24 December 2013 12:58:01 Laurent Pinchart wrote:
> The connectors list iterator returns the list head when the list is
> empty. Fix it by returning NULL in that case.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Could you please take this patch in your tree ?

> ---
>  drivers/gpu/drm/omapdrm/omap_fb.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Changes since v1:
> 
> - Use list_first_entry_or_null
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c
> b/drivers/gpu/drm/omapdrm/omap_fb.c index f2b8f06..2c3acb3 100644
> --- a/drivers/gpu/drm/omapdrm/omap_fb.c
> +++ b/drivers/gpu/drm/omapdrm/omap_fb.c
> @@ -302,7 +302,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) {

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2014-03-28 21:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-24 11:58 [PATCH v2] drm/omap: Don't dereference list head when the connectors list is empty Laurent Pinchart
2014-03-28 21:56 ` Laurent Pinchart [this message]
2014-03-28 23:37   ` Rob Clark

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2173059.lQqA5CBIAz@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robdclark@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.