brcm80211: Don't leak 'vbuffer' in brcmf_sdbrcm_write_vars()
commitc40701eacbaebcfe3fb6fac8ef3da653021c212c
authorJesper Juhl <jj@chaosbits.net>
Sun, 8 Jan 2012 22:41:21 +0000 (8 23:41 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 10 Jan 2012 20:46:40 +0000 (10 15:46 -0500)
tree8b602862745a4988a7652b55c50770d0bfc4471c
parente4922f2b5f1c2b3daa80b56a6eeca984cbee0dde
brcm80211: Don't leak 'vbuffer' in brcmf_sdbrcm_write_vars()

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@chaosbits.net>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c