Sophie

Sophie

distrib > Mandriva > current > i586 > by-pkgid > 3798058a248fdc18b2de3ca3c884cb11 > files > 7

kernel-netbook-2.6.33.7-3mdv2010.1.src.rpm

nouveau: fix missing locking in call to drm_gem_object_unreference

drm_gem_object_unreference is called without locking in
nouveau_gem.c:nouveau_gem_ioctl_new().

Linux commit bc9025bdc4e2b591734cca17697093845007b63d replaces the
call with a call to drm_gem_object_unreference_unlocked() which was
introduced in 2.6.34.

To avoid having to backport core DRM stuff from 2.6.34, just fix the
locking instead.

Signed-off-by: Anssi Hannula <anssi@mandriva.org>

---
 drivers/gpu/drm/nouveau/nouveau_gem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.33/drivers/gpu/drm/nouveau/nouveau_gem.c
===================================================================
--- linux-2.6.33.orig/drivers/gpu/drm/nouveau/nouveau_gem.c	2010-03-16 13:55:58.000000000 +0200
+++ linux-2.6.33/drivers/gpu/drm/nouveau/nouveau_gem.c	2010-03-16 13:57:00.724002356 +0200
@@ -169,10 +169,10 @@ nouveau_gem_ioctl_new(struct drm_device 
 out:
 	mutex_lock(&dev->struct_mutex);
 	drm_gem_object_handle_unreference(nvbo->gem);
-	mutex_unlock(&dev->struct_mutex);
 
 	if (ret)
 		drm_gem_object_unreference(nvbo->gem);
+	mutex_unlock(&dev->struct_mutex);
 	return ret;
 }