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

Commit c04a42f8 authored by Jayant Shekhar's avatar Jayant Shekhar
Browse files

msm: mdss: Use heap instead of stack for panel_info in check var



If add new elements to the structure mdss_panel_info, there
are possibilities to run into build errors as local variable
of mdss_panel_info in function mdss_fb_check_var has huge
size which crossing the 2048 limit. Hence use heap instead
of stack for mdss_panel_info.

Change-Id: I1f07c2f00f5bf6cb494859a85108e3dab8775293
Signed-off-by: default avatarJayant Shekhar <jshekhar@codeaurora.org>
parent 388cfdf9
Loading
Loading
Loading
Loading
+16 −6
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 * Core MDSS framebuffer driver.
 *
 * Copyright (C) 2007 Google Incorporated
 * Copyright (c) 2008-2014, The Linux Foundation. All rights reserved.
 * Copyright (c) 2008-2015, 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
@@ -2878,16 +2878,26 @@ static int mdss_fb_check_var(struct fb_var_screeninfo *var,
		return -EINVAL;

	if (mfd->panel_info) {
		struct mdss_panel_info panel_info;
		struct mdss_panel_info *panel_info;
		int rc;
		panel_info = kzalloc(sizeof(struct mdss_panel_info),
				GFP_KERNEL);
		if (!panel_info) {
			pr_err("panel info is NULL\n");
			return -ENOMEM;
		}

		memcpy(&panel_info, mfd->panel_info, sizeof(panel_info));
		mdss_fb_var_to_panelinfo(var, &panel_info);
		memcpy(panel_info, mfd->panel_info,
				sizeof(struct mdss_panel_info));
		mdss_fb_var_to_panelinfo(var, panel_info);
		rc = mdss_fb_send_panel_event(mfd, MDSS_EVENT_CHECK_PARAMS,
			&panel_info);
		if (IS_ERR_VALUE(rc))
			panel_info);
		if (IS_ERR_VALUE(rc)) {
			kfree(panel_info);
			return rc;
		}
		mfd->panel_reconfig = rc;
		kfree(panel_info);
	}

	return 0;