summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/intel_ringbuffer.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-07-11 00:12:17 +0400
committerKeith Packard <keithp@keithp.com>2011-07-12 19:47:47 +0400
commita7b85d2aa63ed09cd5a4a640772b3272f5ac7caa (patch)
treeba4b1e9a88c18f13f7148c568e8ac21b1340da0a /drivers/gpu/drm/i915/intel_ringbuffer.h
parent1083694ab052e5ba38a8f9a057c4745448977837 (diff)
downloadlinux-a7b85d2aa63ed09cd5a4a640772b3272f5ac7caa.tar.xz
drm/i915: Clean up i915_driver_load failure path
i915_driver_load adds a write-combining MTRR region for the GTT aperture to improve memory speeds through the aperture. If i915_driver_load fails after this, it would not have cleaned up the MTRR. This shouldn't cause any problems, except for consuming an MTRR register. Still, it's best to clean up completely in the failure path, which is easily done by calling mtrr_del if the mtrr was successfully allocated. i915_driver_load calls i915_gem_load which register i915_gem_inactive_shrink. If i915_driver_load fails after calling i915_gem_load, the shrinker will be left registered. When called, it will access freed memory and crash. The fix is to unregister the shrinker in the failure path using code duplicated from i915_driver_unload. i915_driver_load also has some incorrect gotos in the error cleanup paths: * After failing to initialize the GTT (which cannot happen, btw, intel_gtt_get returns a fixed (non-NULL) value), it tries to free the uninitialized WC IO mapping. Fixed this by changing the target from out_iomapfree to out_rmmap Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Lin Ming <ming.m.lin@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.h')
0 files changed, 0 insertions, 0 deletions