Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Tushar Behera <tushar.behera@linaro.org>
Cc: linux-omap@vger.kernel.org, archit@ti.com, patches@linaro.org
Subject: Re: [PATCH] OMAPDSS: OMAPFB: Fix possible null pointer dereferencing
Date: Mon, 19 Nov 2012 10:44:01 +0200	[thread overview]
Message-ID: <50A9F151.3010607@ti.com> (raw)
In-Reply-To: <1353301815-21277-1-git-send-email-tushar.behera@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 1802 bytes --]

On 2012-11-19 07:10, Tushar Behera wrote:
> If display is NULL, display->output would lead to kernel panic.
> 
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
> ---
>  drivers/video/omap2/omapfb/omapfb-ioctl.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
> index 55a39be..532a31b 100644
> --- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
> +++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
> @@ -787,7 +787,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
>  
>  	case OMAPFB_WAITFORVSYNC:
>  		DBG("ioctl WAITFORVSYNC\n");
> -		if (!display && !display->output && !display->output->manager) {
> +		if (!display || !display->output || !display->output->manager) {
>  			r = -EINVAL;
>  			break;
>  		}
> 

Thanks, good catch. However, the patch description is not very good.
If you agree with the change, I'll apply the patch with the description:


OMAPFB: Fix possible null pointer dereferencing                          
                                                                         
Commit 952cbaaa9b8beacc425f9aedf370468cbb737a2c (OMAPFB: Change          
dssdev->manager references) added checks for OMAPFB_WAITFORVSYNC ioctl   
to verify that the display, output and overlay manager exist. However,   
the code erroneously uses && for each part, which means that             
OMAPFB_WAITFORVSYNC may crash the kernel if no display, output or        
manager is associated with the framebuffer.                              
                                                                         
This patch fixes the issue by using ||.                                  


 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 897 bytes --]

  reply	other threads:[~2012-11-19  8:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-19  5:10 [PATCH] OMAPDSS: OMAPFB: Fix possible null pointer dereferencing Tushar Behera
2012-11-19  8:44 ` Tomi Valkeinen [this message]
2012-11-19  9:41   ` Tushar Behera

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=50A9F151.3010607@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=archit@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=tushar.behera@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox