net: atheros: atl1: Use common error handling code in atl1_xmit_frame()
Subsystems (4)
PATCH 1/1 net: atheros: atl1: Use common error handling code in atl1_xmit_frame()
From: Markus Elfring <[email protected]>
Date: Sat, 28 Oct 2017 16:22:30 +0200
Add a jump target so that a bit of exception handling can be better reused at the end of this function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
--- drivers/net/ethernet/atheros/atlx/atl1.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/net/ethernet/atheros/atlx/atl1.c +8 -8
@@ -2424,17 +2424,13 @@ static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb, } tso =atl1_tso (adapter, skb, ptpd); -if (tso <0 ) { -dev_kfree_skb_any (skb); -return NETDEV_TX_OK ; - } +if (tso <0 ) + goto free_skb;if (!tso) { ret_val =atl1_tx_csum (adapter, skb, ptpd); -if (ret_val <0 ) { -dev_kfree_skb_any (skb); -return NETDEV_TX_OK ; - } +if (ret_val <0 ) + goto free_skb; }atl1_tx_map (adapter, skb, ptpd);
@@ -2442,6 +2438,10 @@ static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb,atl1_update_mailbox (adapter);mmiowb ();return NETDEV_TX_OK ; + +free_skb: +dev_kfree_skb_any (skb); +return NETDEV_TX_OK ; }static int atl1_rings_clean (struct napi_struct *napi,int budget)
Signature · 1 line
2.14.3