[PATCH v2] drm/vc4: Fix resource leak in 'vc4_get_hang_state_ioctl()' in error handling path

Eric Anholt eric at anholt.net
Tue Jun 13 00:13:31 UTC 2017


Christophe JAILLET <christophe.jaillet at wanadoo.fr> writes:

> 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

Reviewed and applied.  Thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20170612/c899b959/attachment.sig>


More information about the dri-devel mailing list