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

Commit 03c2e17b authored by Jayant Shekhar's avatar Jayant Shekhar
Browse files

msm: mdss: Fix potential NULL pointer dereference in misr set



If control setup is not done and if userspace calls misr set
via metadata ioctl, then there can be a potential NULL pointer
deference as mixer might be NULL. Add a check to validate if
mixer is not NULL.

Change-Id: I92f5778788cfcce6fa01a038b4321222a8804f28
Signed-off-by: default avatarJayant Shekhar <jshekhar@codeaurora.org>
parent 18d1d8ef
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1244,11 +1244,14 @@ static inline struct mdss_mdp_misr_map *mdss_misr_get_map(u32 block_id,
			if (ctl) {
				mixer = mdss_mdp_mixer_get(ctl,
					MDSS_MDP_MIXER_MUX_DEFAULT);

				if (mixer) {
					ctrl_reg = mixer->base +
						MDSS_MDP_LAYER_MIXER_MISR_CTRL;
					value_reg = mixer->base +
					MDSS_MDP_LAYER_MIXER_MISR_SIGNATURE;
				}
			}
		} else {
			if (block_id <= DISPLAY_MISR_HDMI) {
				intf_base = (char *)mdss_mdp_get_intf_base_addr(