Skip to contentSkip to conversation

vmwgfx: Fix assignment in vmw_framebuffer_create_handle

PATCH New Ryan Mallon 1 participant 1 message Jan 27, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vmwgfx: Fix assignment in vmw_framebuffer_create_handle

The assignment of handle in vmw_framebuffer_create_handle doesn't actually do anything useful and is incorrectly assigning an integer value to a pointer argument. It appears that this is a typo and should be dereferencing handle rather than assigning to it directly. This fixes a bug where an undefined handle value is potentially returned to user-space.

---
Thomas and Jakob have said that a correct fix involves returning the correct user_handle, but also requires changes to userspace. This patch is therefore a temporary fix only. Because it corrects an undefined handle value being returned to userspace, this should also be merged for stable kernels.

drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1 -1
index 0af6ebd..b66ef0e 100644
@@ -378,7 +378,7 @@ int vmw_framebuffer_create_handle(struct drm_framebuffer *fb,
 				  unsigned int *handle)
 {
 	if (handle)
-		handle = 0;
+		*handle = 0;
 
 	return 0;
 }