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

Commit 07291a54 authored by Baldev Sahu's avatar Baldev Sahu Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: KW fixes in MDP driver



Fixes to validate input arguments and return
values of functions.

Change-Id: I3ddef7d944bcdcfff027a57f5e0e4ec121b08104
Signed-off-by: default avatarNirmal Abraham <nabrah@codeaurora.org>
Signed-off-by: default avatarRaghavendra Ambadas <rambad@codeaurora.org>
parent b25832a0
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -1389,6 +1389,7 @@ int hdmi_scdc_read(struct hdmi_tx_ddc_ctrl *ctrl, u32 data_type, u32 *val)
	rc = hdmi_ddc_read(ctrl);
	if (rc) {
		pr_err("DDC Read failed for %s\n", data.what);
		ctrl->ddc_data.data_buf = NULL;
		return rc;
	}

@@ -1428,7 +1429,7 @@ int hdmi_scdc_read(struct hdmi_tx_ddc_ctrl *ctrl, u32 data_type, u32 *val)
	default:
		break;
	}

	ctrl->ddc_data.data_buf = NULL;
	return 0;
}

@@ -1469,7 +1470,7 @@ int hdmi_scdc_write(struct hdmi_tx_ddc_ctrl *ctrl, u32 data_type, u32 val)
		rc = hdmi_ddc_read(ctrl);
		if (rc) {
			pr_err("scdc read failed\n");
			return rc;
			goto scdc_write_fail;
		}
		if (data_type == HDMI_TX_SCDC_SCRAMBLING_ENABLE) {
			data_buf[0] = ((((u8)(read_val & 0xFF)) & (~BIT(0))) |
@@ -1491,7 +1492,8 @@ int hdmi_scdc_write(struct hdmi_tx_ddc_ctrl *ctrl, u32 data_type, u32 val)
	default:
		pr_err("Cannot write to read only reg (%d)\n",
			data_type);
		return -EINVAL;
		rc = -EINVAL;
		goto scdc_write_fail;
	}

	ctrl->ddc_data = data;
@@ -1499,10 +1501,10 @@ int hdmi_scdc_write(struct hdmi_tx_ddc_ctrl *ctrl, u32 data_type, u32 val)
	rc = hdmi_ddc_write(ctrl);
	if (rc) {
		pr_err("DDC Read failed for %s\n", data.what);
		return rc;
	}

	return 0;
scdc_write_fail:
	ctrl->ddc_data.data_buf = NULL;
	return rc;
}

int hdmi_setup_ddc_timers(struct hdmi_tx_ddc_ctrl *ctrl,
+1 −0
Original line number Diff line number Diff line
@@ -709,6 +709,7 @@ int mdss_mdp_get_split_display_ctls(struct mdss_mdp_ctl **ctl,
			swap(*ctl, *sctl);
		}
	} else {
		rc = -EINVAL;
		pr_debug("%s no split mode:%d\n", __func__,
			(*ctl)->mfd->split_mode);
	}