diff options
author | Tushar Behera <tushar.behera@linaro.org> | 2012-11-19 06:10:15 +0100 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-11-19 09:41:50 +0100 |
commit | c415187b689842e8bb85135c070c822c2505f805 (patch) | |
tree | 9304f82bc6a881e9a0a2105651992bd023bdff38 | |
parent | OMAPDSS: HDMI: fix missing unlock on error in hdmi_dump_regs() (diff) | |
download | linux-c415187b689842e8bb85135c070c822c2505f805.tar.xz linux-c415187b689842e8bb85135c070c822c2505f805.zip |
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 ||.
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | 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 606b89f12351..d630b26a005c 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; } |