net: systemport: Free DMA coherent descriptors on errors
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 24 Aug 2017 23:01:13 +0000 (16:01 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 Aug 2017 01:23:21 +0000 (18:23 -0700)
commitc2062ee3d9615828109ffe8089fbf69bed394d05
treea9caed4a4de4a9c9f238fd6ab03c572c92807ea1
parentd4fec855905fa8bd5fb1c59f73ad2d74a944876a
net: systemport: Free DMA coherent descriptors on errors

In case bcm_sysport_init_tx_ring() is not able to allocate ring->cbs, we
would return with an error, and call bcm_sysport_fini_tx_ring() and it
would see that ring->cbs is NULL and do nothing. This would leak the
coherent DMA descriptor area, so we need to free it on error before
returning.

Reported-by: Eric Dumazet <edumazet@gmail.com>
Fixes: 80105befdb4b ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bcmsysport.c