radeon: fix race in sysfs
authorDave Airlie <airlied@redhat.com>
Sun, 2 Nov 2008 23:46:07 +0000 (09:46 +1000)
committerDave Airlie <airlied@redhat.com>
Sun, 2 Nov 2008 23:46:07 +0000 (09:46 +1000)
linux-core/radeon_drv.c

index 3bc0c05..f788172 100644 (file)
@@ -60,8 +60,12 @@ module_param_named(agpmode, radeon_agpmode, int, 0444);
 static int dri_library_name(struct drm_device * dev, char * buf)
 {
        drm_radeon_private_t *dev_priv = dev->dev_private;
-       int family = dev_priv->flags & RADEON_FAMILY_MASK;
+       int family;
 
+       if (!dev_priv)
+               return 0;
+
+       family = dev_priv->flags & RADEON_FAMILY_MASK;
        return snprintf(buf, PAGE_SIZE, "%s\n",
                (family < CHIP_R200) ? "radeon" :
                ((family < CHIP_R300) ? "r200" :