brcmfmac: fix memory leakage in msgbuf
authorArend van Spriel <arend@broadcom.com>
Thu, 7 Aug 2014 12:45:09 +0000 (14:45 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 11 Aug 2014 18:43:51 +0000 (14:43 -0400)
commit2d116b8849474bfce8f8dac5ef671d0d7053c6fc
tree360d48be9352651dac43b86526e5c3a6c7325390
parentebcc2f517d2a667d4f034171ed8f373f85b035df
brcmfmac: fix memory leakage in msgbuf

The kbuild robot came up with the following warning:

tree:   .../kernel/git/linville/wireless-next.git master
head:   dc6be9f54a4ecb0a09765d1f515ed947d86b7528
commit: 9a1bb60250d2b6b546a62e5b73f55c4f1d22016b
 [5/13] brcmfmac: Adding msgbuf protocol.

coccinelle warnings:
 drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c:1309:1-28:
   alloc with no test, possible model on line 1318

Looking into the issue, it turned out that the referred allocation
buffer was not being released in failure path nor upon module
unload.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c