int fb_bar = IS_I9XX(dev) ? 2 : 0;
int ret = 0;
+ dev->devname = kstrdup(DRIVER_NAME, GFP_KERNEL);
+ if (!dev->devname) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
dev->mode_config.fb_base = drm_get_resource_start(dev, fb_bar) &
0xff000000;
else
dev_priv->cursor_needs_physical = false;
- i915_probe_agp(dev, &agp_size, &prealloc_size);
+ ret = i915_probe_agp(dev, &agp_size, &prealloc_size);
+ if (ret)
+ goto kfree_devname;
/* Basic memrange allocator for stolen space (aka vram) */
drm_mm_init(&dev_priv->vram, 0, prealloc_size);
ret = i915_gem_init_ringbuffer(dev);
if (ret)
- goto out;
+ goto kfree_devname;
dev_priv->mm.gtt_mapping =
io_mapping_create_wc(dev->agp->base,
drm_helper_initial_config(dev, false);
- dev->devname = kstrdup(DRIVER_NAME, GFP_KERNEL);
- if (!dev->devname) {
- ret = -ENOMEM;
- goto modeset_cleanup;
- }
-
return 0;
-modeset_cleanup:
- intel_modeset_cleanup(dev);
destroy_ringbuffer:
i915_gem_cleanup_ringbuffer(dev);
+kfree_devname:
+ kfree(dev->devname);
out:
return ret;
}