gpu, drm, sis: Don't return uninitialized variable from sis_driver_load()
authorJesper Juhl <jj@chaosbits.net>
Sat, 14 Jan 2012 20:20:37 +0000 (21:20 +0100)
committerDave Airlie <airlied@redhat.com>
Mon, 23 Jan 2012 11:00:47 +0000 (11:00 +0000)
In sis_driver_load(), the only use of 'ret' is as the return value
from the function, unfortunately it is never initialized, so the
function just returns garbage when it succeeds.
To fix that, remove the variable and just return 0 directly on success.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/sis/sis_drv.c

index 06da063ece2e59681f3c51110006e13e7e58ae0f..573220cc5269fe48d6f0a5fb972c33c5731bb1af 100644 (file)
@@ -40,7 +40,6 @@ static struct pci_device_id pciidlist[] = {
 static int sis_driver_load(struct drm_device *dev, unsigned long chipset)
 {
        drm_sis_private_t *dev_priv;
-       int ret;
 
        dev_priv = kzalloc(sizeof(drm_sis_private_t), GFP_KERNEL);
        if (dev_priv == NULL)
@@ -50,7 +49,7 @@ static int sis_driver_load(struct drm_device *dev, unsigned long chipset)
        dev_priv->chipset = chipset;
        idr_init(&dev->object_name_idr);
 
-       return ret;
+       return 0;
 }
 
 static int sis_driver_unload(struct drm_device *dev)