Skip to content

Commit

Permalink
drm/i915/sprite: Fix mem leak in intel_plane_init()
Browse files Browse the repository at this point in the history
If we ever hit the default case in the switch statement we'll return
from the function without freeing the memory we just allocated to
'intel_plane' (but that has not been used).

This patch gets rid of the leak by freeing the memory just before we
return.

Signed-off-by: Jesper Juhl <[email protected]>
Reviewed-by: Jesse Barnes <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
  • Loading branch information
jjuhl authored and danvet committed Jun 27, 2012
1 parent f4d7105 commit a8b0bba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/intel_sprite.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe)
break;

default:
kfree(intel_plane);
return -ENODEV;
}

Expand All @@ -705,4 +706,3 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe)

return ret;
}

0 comments on commit a8b0bba

Please sign in to comment.