drm/radeon/radeon_connectors.c: add a NULL test before dereference
authorDarren Jenkins <darrenrjenkins@gmail.com>
Wed, 30 Dec 2009 01:22:55 +0000 (12:22 +1100)
committerDave Airlie <airlied@redhat.com>
Thu, 7 Jan 2010 03:48:25 +0000 (13:48 +1000)
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 <darrenrjenkins@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon_connectors.c

index 20161567dbff63ddba53379903c0c5a91d6ceb4e..b82ae61d4d17300c414c30d2eddba9e520eb03e3 100644 (file)
@@ -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);
                }