genet:Fix error handling in the function bcmgenet_fini_gma
Subsystems (2)
Florian Fainelli
NAKQuoted 6 lines · Nicholas Krause
This fixes error handing in the function
bcmgenet_fini_gmato properly check if its internal call to the functionbcm_genet_teardownhas failed by returning a error code and if so return immediately to this function's caller with a return statement as this function call can no longer continue without issues arising from the call to the functionbcm_genet_teardown.
NACK, this is not a good idea, there are specific reasons why the DMA teardown can fail, e.g: when no bandwidth has been allocated at the memory controller level, and we still want to keep tearing down and freeing up resources while we reconfigure the controller one way or the other, this can happen while debugging a system, and this is specific to how GENET is integrated on Broadcom BCM7xxx SoCs.
Also, if you ever need to submit more patches, please look at the git log history and use consistent prefixes, for this driver this would be "net: bcmgenet: blah blah"
Quoted 21 lines
Signed-off-by Nicholas Krause <[email protected]>--- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/ethernet/broadcom/genet/bcmgenet.c +2
-1@@ -2180,7 +2180,8 @@ static void bcmgenet_fini_dma(struct bcmgenet_priv *priv)bcmgenet_fini_tx_napi (priv);/* disable DMA */ -bcmgenet_dma_teardown (priv); +if (bcmgenet_dma_teardown (priv)) +return ;for (i =0 ; i < priv->num_tx_bds; i++) {if (priv->tx_cbs[i].skb !=NULL ) {
Signature · 1 line
Florian