brcmsmac: Free packet if dma_mapping_error() fails in dma_rxfill
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 18 Jul 2016 23:24:35 +0000 (16:24 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Oct 2016 13:23:46 +0000 (15:23 +0200)
commit3d0ef898fbbea4406e8a0b15201348bc30a2cadd
tree329396ff9904f28ee796752c1d8879f95106eab0
parenta6501617e689ad80c4d185e0d8f485e0d0b1a708
brcmsmac: Free packet if dma_mapping_error() fails in dma_rxfill

commit 5c5fa1f464ac954982df1d96b9f9a5103d21aedd upstream.

In case dma_mapping_error() returns an error in dma_rxfill, we would be
leaking a packet that we allocated with brcmu_pkt_buf_get_skb().

Reported-by: coverity (CID 1081819)
Fixes: 67d0cf50bd32 ("brcmsmac: Fix WARNING caused by lack of calls to dma_mapping_error()")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/brcm80211/brcmsmac/dma.c