All of lore.kernel.org
 help / color / mirror / Atom feed
From: Inki Dae <inki.dae@samsung.com>
To: 'Sachin Kamat' <sachin.kamat@linaro.org>
Cc: dri-devel@lists.freedesktop.org, patches@linaro.org
Subject: RE: [PATCH 1/1] drm/exynos: Fix potential NULL pointer dereference in exynos_drm_encoder.c
Date: Thu, 22 Nov 2012 17:26:02 +0900	[thread overview]
Message-ID: <024e01cdc88b$02636490$072a2db0$%dae@samsung.com> (raw)
In-Reply-To: <CAK9yfHz=ATWzMtwpaCUBB=90QqyNJvYCqi0+4AOudW6cwrr85A@mail.gmail.com>



> -----Original Message-----
> From: Sachin Kamat [mailto:sachin.kamat@linaro.org]
> Sent: Thursday, November 22, 2012 5:19 PM
> To: Inki Dae
> Cc: dri-devel@lists.freedesktop.org; jy0922.shim@samsung.com;
> patches@linaro.org
> Subject: Re: [PATCH 1/1] drm/exynos: Fix potential NULL pointer
> dereference in exynos_drm_encoder.c
> 
> [snip]
> >> >> And NULL pointer checking was already done above like below,
> >> >>         if (overlay_ops && overlay_ops->disable)
> >> >>                 overlay_ops->disable(manager->dev, zpos);
> >> > Correct. But that check is applicable only for that one statement
> >> > (overlay_ops->disable(manager->dev, zpos);).
> >> >
> >> > Similar check needs to be added to below 'if' code too.
> >>
> >> What are your comments about this?
> >>
> >
> > Left condition first is checked so as I mentioned before, it doesn't
> need
> > overlay_ops checking because that was checked already. why do you think
> > overlay_ops should be checked again?
> >
> 
> Consider the case when overlay_ops is NULL.
> 
> if (overlay_ops && overlay_ops->disable)
>                  overlay_ops->disable(manager->dev, zpos);
> 
> It does not enter this condition as overlay_ops is NULL and moves to
> the next statement,
> if (overlay_ops->wait_for_vblank) where it gets dereferenced.
> 
> Please note we are not returning back from the first condition if
> overlay_ops is NULL.
> Hence we need to check the condition in second case too.
> 

Ah~ Right. I didn't check it surely. :)

Thanks,
Inki Dae

> --
> With warm regards,
> Sachin

      reply	other threads:[~2012-11-22  8:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-19  9:20 [PATCH 1/1] drm/exynos: Fix potential NULL pointer dereference in exynos_drm_encoder.c Sachin Kamat
2012-11-19  9:44 ` Inki Dae
2012-11-19  9:55   ` Sachin Kamat
2012-11-19 10:00     ` Inki Dae
2012-11-19 10:02       ` Sachin Kamat
2012-11-22  6:13         ` Sachin Kamat
2012-11-22  8:11           ` Inki Dae
2012-11-22  8:18             ` Sachin Kamat
2012-11-22  8:26               ` Inki Dae [this message]

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='024e01cdc88b$02636490$072a2db0$%dae@samsung.com' \
    --to=inki.dae@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=patches@linaro.org \
    --cc=sachin.kamat@linaro.org \
    /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.