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

Commit 45ccac50 authored by Tharun Raj Soma's avatar Tharun Raj Soma
Browse files

drm/msm/dsi-staging: Fix buffer overflow and Null pointer dereference



This change fixes two issues in DSI driver: fix for Buffer Overflow-
Local Array Index Out of Bounds and fix for Pointer will be dereferenced
after it was positively checked for NULL.

Change-Id: I71741ead2f34e44de73a18c480bff3c07855a885
Signed-off-by: default avatarTharun Raj Soma <tsoma@codeaurora.org>
parent 8693e8f6
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1785,7 +1785,8 @@ static void dsi_config_host_engine_state_for_cont_splash
	enum dsi_engine_state host_state = DSI_CTRL_ENGINE_ON;

	/* Sequence does not matter for split dsi usecases */
	for (i = 0; i < display->ctrl_count; i++) {
	for (i = 0; (i < display->ctrl_count) &&
			(i < MAX_DSI_CTRLS_PER_DISPLAY); i++) {
		ctrl = &display->ctrl[i];
		if (!ctrl->ctrl)
			continue;
@@ -3929,8 +3930,13 @@ int dsi_display_cont_splash_config(void *dsi_display)
	struct dsi_display *display = dsi_display;
	int rc = 0;

	if (!display) {
		pr_err("Invalid display\n");
		return -EINVAL;
	}

	/* Continuous splash not supported by external bridge */
	if (!display || dsi_display_has_ext_bridge(display)) {
	if (dsi_display_has_ext_bridge(display)) {
		display->is_cont_splash_enabled = false;
		return 0;
	}