From: Darren Jenkins Date: Wed, 30 Dec 2009 01:22:55 +0000 (+1100) Subject: drm/radeon/radeon_connectors.c: add a NULL test before dereference X-Git-Tag: v3.0~6071^2~55^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d8a7f79246a447722bd90c2c4ba3ca068b2aa4c0;p=platform%2Fkernel%2Flinux-amlogic.git drm/radeon/radeon_connectors.c: add a NULL test before dereference The encoder variable can be NULL in this function so I believe it should be checked before dereference. Coverity CID: 13253 [airlied: extremely unlikely to happen] Signed-off-by: Darren Jenkins Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 2016156..b82ae61 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -615,7 +615,7 @@ static enum drm_connector_status radeon_vga_detect(struct drm_connector *connect ret = connector_status_connected; } } else { - if (radeon_connector->dac_load_detect) { + if (radeon_connector->dac_load_detect && encoder) { encoder_funcs = encoder->helper_private; ret = encoder_funcs->detect(encoder, connector); }