diff mbox

[BUG] 2.6.36-rc showstopper (at least for me) in vmwgfx

Message ID 4CAA5BDA.7080705@tuxonice.net (mailing list archive)
State New, archived
Headers show

Commit Message

Nigel Cunningham Oct. 4, 2010, 10:57 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 72ec2e2..1ca0ebc 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -343,8 +343,16 @@  static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
 
        dev->dev_private = dev_priv;
 
-       if (!dev->devname)
-               dev->devname = vmw_devname;
+       if (!dev->devname) {
+               dev->devname = kmalloc(strlen(vmw_devname) + 1, GFP_KERNEL);
+               if (!dev->devname) {
+                       DRM_ERROR("Unable to allocate memory for device "
+                                       "name.\n");
+                       ret = -ENOMEM;
+                       goto out_err4;
+               }
+               strcpy(dev->devname, vmw_devname);
+       }
 
        if (dev_priv->capabilities & SVGA_CAP_IRQMASK) {
                ret = drm_irq_install(dev);