Merge "msm: mdss: Check ctl in mdss_mdp_mixer_get before using"
diff --git a/drivers/video/msm/mdss/mdss_mdp_ctl.c b/drivers/video/msm/mdss/mdss_mdp_ctl.c
index 4f9045e..aa7c4dd 100644
--- a/drivers/video/msm/mdss/mdss_mdp_ctl.c
+++ b/drivers/video/msm/mdss/mdss_mdp_ctl.c
@@ -1560,9 +1560,17 @@
struct mdss_mdp_mixer *mdss_mdp_mixer_get(struct mdss_mdp_ctl *ctl, int mux)
{
struct mdss_mdp_mixer *mixer = NULL;
- struct mdss_overlay_private *mdp5_data = mfd_to_mdp5_data(ctl->mfd);
- if (!ctl)
+ struct mdss_overlay_private *mdp5_data = NULL;
+ if (!ctl || !ctl->mfd) {
+ pr_err("ctl not initialized\n");
return NULL;
+ }
+
+ mdp5_data = mfd_to_mdp5_data(ctl->mfd);
+ if (!mdp5_data) {
+ pr_err("ctl not initialized\n");
+ return NULL;
+ }
switch (mux) {
case MDSS_MDP_MIXER_MUX_DEFAULT: