From: Jesse Barnes Date: Wed, 11 Feb 2009 21:28:14 +0000 (-0800) Subject: drm/i915: take struct mutex around fb unref X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=496818f08a78476abdb307e241911536221239fc;p=linux-2.6-omap-h63xx.git drm/i915: take struct mutex around fb unref Need to do this in case the unref ends up doing a free. Signed-off-by: Jesse Barnes Signed-off-by: Eric Anholt Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 13f9b6667c9..4d2baf7b00b 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -1606,7 +1606,9 @@ intel_user_framebuffer_create(struct drm_device *dev, ret = intel_framebuffer_create(dev, mode_cmd, &fb, obj); if (ret) { + mutex_lock(&dev->struct_mutex); drm_gem_object_unreference(obj); + mutex_unlock(&dev->struct_mutex); return NULL; }