Commit 52749d60 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Rob Clark

drm/msm/dsi: Fix potential NULL pointer dereference in msm_dsi_modeset_init

_dev_ is being dereferenced before it is null checked, hence there
is a potential null pointer dereference.

Fix this by moving the pointer dereference after _dev_ has been
null checked.

Fixes: d4e7f38d70ef ("drm/msm/dsi: check msm_dsi and dsi pointers before use")
Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent 5abc7dd7
...@@ -192,13 +192,14 @@ void __exit msm_dsi_unregister(void) ...@@ -192,13 +192,14 @@ void __exit msm_dsi_unregister(void)
int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
struct drm_encoder *encoder) struct drm_encoder *encoder)
{ {
struct msm_drm_private *priv = dev->dev_private; struct msm_drm_private *priv;
struct drm_bridge *ext_bridge; struct drm_bridge *ext_bridge;
int ret; int ret;
if (WARN_ON(!encoder) || WARN_ON(!msm_dsi) || WARN_ON(!dev)) if (WARN_ON(!encoder) || WARN_ON(!msm_dsi) || WARN_ON(!dev))
return -EINVAL; return -EINVAL;
priv = dev->dev_private;
msm_dsi->dev = dev; msm_dsi->dev = dev;
ret = msm_dsi_host_modeset_init(msm_dsi->host, dev); ret = msm_dsi_host_modeset_init(msm_dsi->host, dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment