public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] staging: vt6656: Fix possible leak in vnt_download_firmware()
       [not found] <1423683195-12843-1-git-send-email-cengelma@gmx.at>
@ 2015-02-12 14:00 ` Martin Kepplinger
  0 siblings, 0 replies; only message in thread
From: Martin Kepplinger @ 2015-02-12 14:00 UTC (permalink / raw)
  To: Christian Engelmayer, devel
  Cc: gregkh, forest, tvboxspy, tapaswenipathak, dan.carpenter, ced,
	linux-kernel

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-12 14:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1423683195-12843-1-git-send-email-cengelma@gmx.at>
2015-02-12 14:00 ` [PATCH] staging: vt6656: Fix possible leak in vnt_download_firmware() Martin Kepplinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox