From: Martin Kepplinger <martink@posteo.de>
To: Christian Engelmayer <cengelma@gmx.at>, devel@driverdev.osuosl.org
Cc: gregkh@linuxfoundation.org, forest@alittletooquiet.net,
tvboxspy@gmail.com, tapaswenipathak@gmail.com,
dan.carpenter@oracle.com, ced@ryick.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: vt6656: Fix possible leak in vnt_download_firmware()
Date: Thu, 12 Feb 2015 15:00:26 +0100 [thread overview]
Message-ID: <54DCB1FA.1050401@posteo.de> (raw)
In-Reply-To: <1423683195-12843-1-git-send-email-cengelma@gmx.at>
Am 2015-02-11 um 20:33 schrieb Christian Engelmayer:
> When failing to allocate buffer memory, function vnt_download_firmware() goes
> through the wrong exit path and fails to release the already requested
> firmware. Thus use the correct cleanup. Detected by Coverity CID 1269128.
>
> Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
> ---
> Compile tested only. Applies against branch staging-next.
> ---
> drivers/staging/vt6656/firmware.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/vt6656/firmware.c b/drivers/staging/vt6656/firmware.c
> index a177645af83e..d440f284bf18 100644
> --- a/drivers/staging/vt6656/firmware.c
> +++ b/drivers/staging/vt6656/firmware.c
> @@ -61,7 +61,7 @@ int vnt_download_firmware(struct vnt_private *priv)
>
> buffer = kmalloc(FIRMWARE_CHUNK_SIZE, GFP_KERNEL);
> if (!buffer)
> - goto out;
> + goto free_fw;
>
> for (ii = 0; ii < fw->size; ii += FIRMWARE_CHUNK_SIZE) {
> length = min_t(int, fw->size - ii, FIRMWARE_CHUNK_SIZE);
>
looks good to me, although somebody else should review it too. feel free
to add
Reviewed-by: Martin Kepplinger <martink@posteo.de>
if applicable.
parent reply other threads:[~2015-02-12 14:00 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1423683195-12843-1-git-send-email-cengelma@gmx.at>]
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=54DCB1FA.1050401@posteo.de \
--to=martink@posteo.de \
--cc=ced@ryick.net \
--cc=cengelma@gmx.at \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=forest@alittletooquiet.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tapaswenipathak@gmail.com \
--cc=tvboxspy@gmail.com \
/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