i915: fix small leak on error path
Subsystems (3)
PATCH 1/1 i915: fix small leak on error path
We should free "params" before returning.
drivers/gpu/drm/i915/intel_overlay.c +9 -4
@@ -1068,14 +1068,18 @@ int intel_overlay_put_image(struct drm_device *dev, void *data, drmmode_obj =drm_mode_object_find (dev, put_image_rec->crtc_id,DRM_MODE_OBJECT_CRTC ); -if (!drmmode_obj) -return -ENOENT ; +if (!drmmode_obj) { + ret = -ENOENT ; + goto out_free; + } crtc =to_intel_crtc (obj_to_crtc (drmmode_obj)); new_bo =drm_gem_object_lookup (dev, file_priv, put_image_rec->bo_handle); -if (!new_bo) -return -ENOENT ; +if (!new_bo) { + ret = -ENOENT ; + goto out_free; + }mutex_lock (&dev->mode_config.mutex);mutex_lock (&dev->struct_mutex);
@@ -1165,6 +1169,7 @@ out_unlock:mutex_unlock (&dev->struct_mutex);mutex_unlock (&dev->mode_config.mutex);drm_gem_object_unreference_unlocked (new_bo); +out_free:kfree (params);return ret;
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
Oh, dang. Thanks for catching this. Eric, please merge.
Quoted 39 lines · Dan Carpenter
We should free "params" before returning.
Signed-off-by Dan Carpenter <[email protected]>drivers/gpu/drm/i915/intel_overlay.c +9
-4@@ -1068,14 +1068,18 @@ int intel_overlay_put_image(struct drm_device *dev, void *data, drmmode_obj =drm_mode_object_find (dev, put_image_rec->crtc_id,DRM_MODE_OBJECT_CRTC ); -if (!drmmode_obj) -return -ENOENT ; +if (!drmmode_obj) { + ret = -ENOENT ; + goto out_free; + } crtc =to_intel_crtc (obj_to_crtc (drmmode_obj)); new_bo =drm_gem_object_lookup (dev, file_priv, put_image_rec->bo_handle); -if (!new_bo) -return -ENOENT ; +if (!new_bo) { + ret = -ENOENT ; + goto out_free; + }mutex_lock (&dev->mode_config.mutex);mutex_lock (&dev->struct_mutex);@@ -1165,6 +1169,7 @@ out_unlock:mutex_unlock (&dev->struct_mutex);mutex_unlock (&dev->mode_config.mutex);drm_gem_object_unreference_unlocked (new_bo); +out_free:kfree (params);return ret;
Signature · 3 lines
Daniel Vetter Mail: [email protected] Mobile: +41 (0)79 365 57 48
Eric Anholt
AppliedQuoted 9 lines · Daniel Vetter
Oh, dang. Thanks for catching this. Eric, please merge.
Cc [email protected] (for .33)Reviewed-by Daniel Vetter <[email protected]>Quoted 3 lines · Dan Carpenter
We should free "params" before returning.
Signed-off-by Dan Carpenter <[email protected]>
Applied. Thanks!
Eric Anholt
AppliedQuoted 9 lines · Daniel Vetter
Oh, dang. Thanks for catching this. Eric, please merge.
Cc [email protected] (for .33)Reviewed-by Daniel Vetter <[email protected]>Quoted 3 lines · Dan Carpenter
We should free "params" before returning.
Signed-off-by Dan Carpenter <[email protected]>
Applied. Thanks!
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel