From: Sachin Kamat Date: Mon, 19 Nov 2012 09:44:57 +0000 (+0000) Subject: drm/crtc: Fix potential NULL pointer dereference X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e655d122a71332d0d26b5c0909eb395da31af0c0;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Dave Airlie --- 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, size = EDID_LENGTH * (1 + edid->extensions); connector->edid_blob_ptr = drm_property_create_blob(connector->dev, size, edid); + if (!connector->edid_blob_ptr) + return -EINVAL; ret = drm_connector_property_set_value(connector, dev->mode_config.edid_property,