Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a39796ab authored by Chirag Khurana's avatar Chirag Khurana Committed by Gerrit - the friendly Code Review server
Browse files

msm: fbdev: add safety check for msm fb data object



Add NULL pointer safety check on msm fb data object to
prevent NULL access in rare display user-space usecase
of launching multiple window managers simultaneously.

Change-Id: Ib8baf78b2cbaceb19569693ad9faf53f6b2d1c9f
Signed-off-by: default avatarChirag Khurana <ckhurana@codeaurora.org>
parent f8cb0592
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 * Core MDSS framebuffer driver.
 *
 * Copyright (C) 2007 Google Incorporated
 * Copyright (c) 2008-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2008-2019, The Linux Foundation. All rights reserved.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
@@ -3579,6 +3579,9 @@ static int mdss_fb_pan_display_sub(struct fb_var_screeninfo *var,
{
	struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par;

	if (!mfd)
		return -EPERM;

	if (!mfd->op_enable)
		return -EPERM;