summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/mxsfb.c
diff options
context:
space:
mode:
authorCristina Ciocan <cristina-mihaela.ciocan@nxp.com>2017-01-30 11:31:21 +0200
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit32fc62e3b63b31526ad38a55d9bd814b18336c06 (patch)
treea01b0efaa5805be93306b6228bb588ca73c594a9 /drivers/video/fbdev/mxsfb.c
parent3712f05b08cf50e4a9a6828a95f417df2e928a3a (diff)
MLK-13840 fbdev: mxsfb: Fix explicit null dereference
In mxsfb driver, function overlayfb_check_var, a null pointer dereference occurs if fourcc pixel format is one not considered explicitly. This case should not occur, since the pixel format is verified against supported values before getting to this null dereference code, but this may change if overlay_fmt_support() or overlayfb_check_var() changes and they are not kept in sync. Signed-off-by: Cristina Ciocan <cristina-mihaela.ciocan@nxp.com>
Diffstat (limited to 'drivers/video/fbdev/mxsfb.c')
-rw-r--r--drivers/video/fbdev/mxsfb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c
index e0a1199a21f7..63db6a29d507 100644
--- a/drivers/video/fbdev/mxsfb.c
+++ b/drivers/video/fbdev/mxsfb.c
@@ -1793,6 +1793,14 @@ static int overlayfb_check_var(struct fb_var_screeninfo *var,
case V4L2_PIX_FMT_RGB565:
rgb = def_rgb565;
break;
+ default:
+ /*
+ * This should never be reached since the verification
+ * is done in overlay_fmt_support(), but handle this in
+ * case there will be a sync error between formats
+ * supported in fmt_support and this function.
+ */
+ return -EINVAL;
}
break;
}