@@ -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);