diff --git a/drivers/video/msm/msm_fb.c b/drivers/video/msm/msm_fb.c index 87492e6f..c706422d 100644 --- a/drivers/video/msm/msm_fb.c +++ b/drivers/video/msm/msm_fb.c @@ -3730,7 +3730,7 @@ static int msmfb_display_commit(struct fb_info *info, static int msm_fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) { - struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; + struct msm_fb_data_type *mfd; void __user *argp = (void __user *)arg; struct fb_cursor cursor; struct fb_cmap cmap; @@ -3748,6 +3748,10 @@ static int msm_fb_ioctl(struct fb_info *info, unsigned int cmd, struct mdp_buf_sync buf_sync; int ret = 0; msm_fb_pan_idle(mfd); + + if (!info || !info->par) + return -EINVAL; + mfd = (struct msm_fb_data_type *)info->par; switch (cmd) { #ifdef CONFIG_FB_MSM_OVERLAY