aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2012-11-19 04:44:57 -0500
committerDave Airlie <airlied@redhat.com>2012-11-20 00:40:51 -0500
commite655d122a71332d0d26b5c0909eb395da31af0c0 (patch)
treeb21b2da3e7cbd4466e0b266c984b0144dfb1c8bc
parent9e1c156ff04b1920c33b59c5b8564afc8bf4f2cd (diff)
drm/crtc: Fix potential NULL pointer dereference
drm_property_create_blob() could return NULL in which case NULL pointer dereference error (on connector->edid_blob_ptr) is possible. Return if connector->edid_blob_ptr is NULL. Fixes the following smatch error: drivers/gpu/drm/drm_crtc.c:3186 drm_mode_connector_update_edid_property() error: potential null dereference 'connector->edid_blob_ptr'. (drm_property_create_blob returns null) Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_crtc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 9fd0c3555c30..6a1b2cc39898 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -3191,6 +3191,8 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
3191 size = EDID_LENGTH * (1 + edid->extensions); 3191 size = EDID_LENGTH * (1 + edid->extensions);
3192 connector->edid_blob_ptr = drm_property_create_blob(connector->dev, 3192 connector->edid_blob_ptr = drm_property_create_blob(connector->dev,
3193 size, edid); 3193 size, edid);
3194 if (!connector->edid_blob_ptr)
3195 return -EINVAL;
3194 3196
3195 ret = drm_connector_property_set_value(connector, 3197 ret = drm_connector_property_set_value(connector,
3196 dev->mode_config.edid_property, 3198 dev->mode_config.edid_property,