Skip to content

Commit

Permalink
OMAPFB: Fix possible null pointer dereferencing
Browse files Browse the repository at this point in the history
Commit 952cbaa (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>
  • Loading branch information
Tushar Behera authored and Tomi Valkeinen committed Nov 19, 2012
1 parent dffc70a commit c415187
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/video/omap2/omapfb/omapfb-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c415187

Please sign in to comment.