From: Eric Anholt <eric@anholt.net>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>, airlied@linux.ie
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: Re: [PATCH v2] drm/vc4: Fix resource leak in 'vc4_get_hang_state_ioctl()' in error handling path
Date: Mon, 12 Jun 2017 17:13:31 -0700 [thread overview]
Message-ID: <87a85cycb8.fsf@eliezer.anholt.net> (raw)
In-Reply-To: <20170512123803.1886-1-christophe.jaillet@wanadoo.fr>
[-- Attachment #1: Type: text/plain, Size: 591 bytes --]
Christophe JAILLET <christophe.jaillet@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!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
prev parent reply other threads:[~2017-06-13 0:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-12 12:38 Christophe JAILLET
2017-06-13 0:13 ` Eric Anholt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a85cycb8.fsf@eliezer.anholt.net \
--to=eric@anholt.net \
--cc=airlied@linux.ie \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®