Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2dc3a8e0 authored by Dave Jones's avatar Dave Jones Committed by John W. Linville
Browse files

brcmfmac: fix skb leak in brcmf_sdio_txpkt_prep_sg error path.



Commit 1eb43018 (brcmfmac: fix txglomming scatter-gather packet transfers)
added an allocation of an skb via brcmu_pkt_buf_get_skb() but forgot to
free it on one of the error paths.

Acked-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarDave <Jones&lt;davej@fedoraproject.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d5124648
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1948,8 +1948,10 @@ static int brcmf_sdio_txpkt_prep_sg(struct brcmf_sdio *bus,
		if (pkt_pad == NULL)
			return -ENOMEM;
		ret = brcmf_sdio_txpkt_hdalign(bus, pkt_pad);
		if (unlikely(ret < 0))
		if (unlikely(ret < 0)) {
			kfree_skb(pkt_pad);
			return ret;
		}
		memcpy(pkt_pad->data,
		       pkt->data + pkt->len - tail_chop,
		       tail_chop);