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" <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm/omap: Don't dereference list head when the connectors list is empty
Date: Mon, 23 Dec 2013 19:15:16 +0100	[thread overview]
Message-ID: <32276855.3vUhbVWhQQ@avalon> (raw)
In-Reply-To: <CAF6AEGtJmZxiq8N84OWoWJ-xExSEggBC0h0io04fPyu+xuDzOw@mail.gmail.com>

Hi Rob,

On Monday 23 December 2013 13:04:15 Rob Clark wrote:
> On Mon, Dec 23, 2013 at 10:27 AM, Laurent Pinchart
> 
> <laurent.pinchart@ideasonboard.com> 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>
> 
> Thanks
> 
> Signed-off-by: Rob Clark <robdclark@gmail.com>

Thank you. Could you please take this in your tree, or make sure that Dave 
picks the patch from the list ?

> > ---
> > 
> >  drivers/gpu/drm/omapdrm/omap_fb.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c
> > b/drivers/gpu/drm/omapdrm/omap_fb.c index f2b8f06..1b48cf2 100644
> > --- a/drivers/gpu/drm/omapdrm/omap_fb.c
> > +++ b/drivers/gpu/drm/omapdrm/omap_fb.c
> > @@ -301,8 +301,11 @@ struct drm_connector
> > *omap_framebuffer_get_next_connector(> 
> >         struct list_head *connector_list =
> >         &dev->mode_config.connector_list;
> >         struct drm_connector *connector = from;
> > 
> > -       if (!from)
> > +       if (!from) {
> > +               if (list_empty(connector_list))
> > +                       return NULL;
> >                 return list_first_entry(connector_list, typeof(*from),
> >                 head);
> > +       }
> > 
> >         list_for_each_entry_from(connector, connector_list, head) {
> >                 if (connector != from) {
-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2013-12-23 18:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-23 15:27 [PATCH] drm/omap: Don't dereference list head when the connectors list is empty Laurent Pinchart
2013-12-23 18:04 ` Rob Clark
2013-12-23 18:15   ` Laurent Pinchart [this message]
2013-12-24  6:35 ` Archit Taneja

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=32276855.3vUhbVWhQQ@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.