linux/drivers/gpu/drm/vc4
Christophe JAILLET d0b1d259a4 drm/vc4: Fix resource leak in 'vc4_get_hang_state_ioctl()' in error handling path
If one 'drm_gem_handle_create()' fails, we leak somes handles and some
memory.

In order to fix it:
  - move the 'free(bo_state)' at the end of the function so that it is also
    called in the eror handling path. This has the side effect to also try
    to free it if the first 'kcalloc' fails. This is harmless.
  - add a new label, err_delete_handle, in order to delete already
    allocated handles in error handling path
  - remove the now useless 'err' label

The way the code is now written will also delete the handles if the
'copy_to_user()' call fails.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: http://patchwork.freedesktop.org/patch/msgid/20170512123803.1886-1-christophe.jaillet@wanadoo.fr
2017-06-12 17:11:39 -07:00
..
Kconfig drm/vc4: Switch DSI to the panel-bridge layer, and support bridges. 2017-06-05 15:07:37 +05:30
Makefile drm/vc4: fix include notation and remove -Iinclude/drm flag 2017-05-22 09:36:01 +02:00
vc4_bo.c drm/vc4/vc4_bo.c: always set bo->resv 2017-06-12 16:48:03 -07:00
vc4_crtc.c drm/vc4: use drm_for_each_connector_iter() 2017-05-26 02:12:44 -03:00
vc4_debugfs.c drm/vc4: Add DSI driver 2017-02-01 12:51:23 -08:00
vc4_dpi.c drm/vc4: Switch DPI to using the panel-bridge helper. 2017-06-05 15:21:26 +05:30
vc4_drv.c drm/vc4: fix include notation and remove -Iinclude/drm flag 2017-05-22 09:36:01 +02:00
vc4_drv.h drm/vc4: Fix comment in vc4_drv.h 2017-05-31 10:50:54 -07:00
vc4_dsi.c drm/vc4: Switch DSI to the panel-bridge layer, and support bridges. 2017-06-05 15:07:37 +05:30
vc4_fence.c drm/vc4: Expose dma-buf fences for V3D rendering. 2017-04-13 11:00:28 -07:00
vc4_gem.c drm/vc4: Fix resource leak in 'vc4_get_hang_state_ioctl()' in error handling path 2017-06-12 17:11:39 -07:00
vc4_hdmi.c drm/vc4: fix include notation and remove -Iinclude/drm flag 2017-05-22 09:36:01 +02:00
vc4_hvs.c drm/vc4: fix include notation and remove -Iinclude/drm flag 2017-05-22 09:36:01 +02:00
vc4_irq.c drm/vc4: Allow using more than 256MB of CMA memory. 2017-04-18 14:32:20 -07:00
vc4_kms.c drm/vc4: fix include notation and remove -Iinclude/drm flag 2017-05-22 09:36:01 +02:00
vc4_packet.h drm/vc4: Add support for drawing 3D frames. 2015-12-07 20:05:10 -08:00
vc4_plane.c drm/vc4: fix include notation and remove -Iinclude/drm flag 2017-05-22 09:36:01 +02:00
vc4_qpu_defines.h drm/vc4: Fix definition of QPU_R_MS_REV_FLAGS 2016-07-15 15:19:52 -07:00
vc4_regs.h drm/vc4: Add HDMI audio support 2017-03-16 10:33:30 -07:00
vc4_render_cl.c drm/vc4: Allow using more than 256MB of CMA memory. 2017-04-18 14:32:20 -07:00
vc4_trace_points.c drm/vc4: Add support for drawing 3D frames. 2015-12-07 20:05:10 -08:00
vc4_trace.h drm/vc4: Add support for drawing 3D frames. 2015-12-07 20:05:10 -08:00
vc4_v3d.c drm/vc4: Mark the device as active when enabling runtime PM. 2017-06-02 13:00:47 -07:00
vc4_validate_shaders.c drm/vc4: Extend and edit documentation for output from the RST 2017-02-28 12:51:49 -08:00
vc4_validate.c drm/vc4: fix spelling mistake: "dimesions" -> "dimensions" 2017-05-16 09:42:20 -07:00
vc4_vec.c drm/vc4: Extend and edit documentation for output from the RST 2017-02-28 12:51:49 -08:00