drm/msm/shd: fix null pointer dereferenced

Add one safe judging condition for the variable 'm' to avoid null
pointer dereferenced.

Change-Id: I0848b3e56f3d77f0783789b09b4b9e20955dc6a0
Signed-off-by: Shilun Wan <swan@codeaurora.org>
tirimbino
Shilun Wan 5 years ago committed by Gerrit - the friendly Code Review server
parent 0b5e81a5af
commit 7550c2942b
  1. 2
      drivers/gpu/drm/msm/shd/shd_drm.c

@ -616,6 +616,8 @@ static int shd_connector_get_modes(struct drm_connector *connector,
drm_mode.vtotal = drm_mode.vsync_end;
m = drm_mode_duplicate(disp->drm_dev, &drm_mode);
if (!m)
return 0;
drm_mode_set_name(m);
drm_mode_probed_add(connector, m);
rc = shd_drm_update_edid_name(&edid, disp->name);

Loading…
Cancel
Save