Re: [PATCH] brcm80211: Don't leak 'vbuffer' inbrcmf_sdbrcm_write_vars()

From: Arend van Spriel
Date: Mon Jan 09 2012 - 05:01:37 EST


On 01/08/2012 11:41 PM, Jesper Juhl wrote:
> If the memory allocation 'nvram_ularray = kmalloc(varsize,
> GFP_ATOMIC);' fails we'll leak the memory allocated to 'vbuffer' when
> we return -ENOMEM from the function.
>
> This patch resolves the leak by kfree()'ing the allocated memory
> before the return.
>
> Signed-off-by: Jesper Juhl <jj@xxxxxxxxxxxxx>

Nice catch. Thanks.

Acked-by: Arend van Spriel <arend@xxxxxxxxxxxx>

Gr. AvS

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/