[<prev] [next>] [day] [month] [year] [list]
Message-ID: <54DCB1FA.1050401@posteo.de>
Date: Thu, 12 Feb 2015 15:00:26 +0100
From: Martin Kepplinger <martink@...teo.de>
To: Christian Engelmayer <cengelma@....at>, devel@...verdev.osuosl.org
CC: gregkh@...uxfoundation.org, forest@...ttletooquiet.net,
tvboxspy@...il.com, tapaswenipathak@...il.com,
dan.carpenter@...cle.com, ced@...ck.net,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: vt6656: Fix possible leak in vnt_download_firmware()
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@....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@...teo.de>
if applicable.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists