Skip to contentSkip to conversation

i915: signedness bug in check_overlay_src()

PATCH Applied Dan Carpenter 2 participants 2 messages Oct 27, 2010

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

PATCH 1/1 i915: signedness bug in check_overlay_src()

"depth" should be signed in case packed_depth_bytes() returns -EINVAL.

This probably doesn't make a difference at runtime. In the original code we would return -EINVAL later if (rec->offset_Y % 4294967274) is non-zero.

drivers/gpu/drm/i915/intel_overlay.c +3 -1
index afb96d2..02ff0a4 100644
@@ -946,7 +946,9 @@ static int check_overlay_src(struct drm_device *dev,
 {
 	int uv_hscale = uv_hsubsampling(rec->flags);
 	int uv_vscale = uv_vsubsampling(rec->flags);
-	u32 stride_mask, depth, tmp;
+	u32 stride_mask;
+	int depth;
+	u32 tmp;
 
 	/* check src dimensions */
 	if (IS_845G(dev) || IS_I830(dev)) {
Applied
#1 lore raw
Quoted 5 lines · Dan Carpenter

"depth" should be signed in case packed_depth_bytes() returns -EINVAL.

This probably doesn't make a difference at runtime. In the original code we would return -EINVAL later if (rec->offset_Y % 4294967274) is non-zero.

Applied to fixes, thanks.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre