From: Markus Elfring <elfr...@users.sourceforge.net> Date: Wed, 8 Nov 2017 10:10:41 +0100
The same exception handling was used in an if branch of two separate statements. * Merge their condition checks into a single statement instead. * Delete the local variable "ret" which became unnecessary with this refactoring. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfr...@users.sourceforge.net> --- net/ieee802154/6lowpan/tx.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/net/ieee802154/6lowpan/tx.c b/net/ieee802154/6lowpan/tx.c index e6ff5128e61a..1b0757db2078 100644 --- a/net/ieee802154/6lowpan/tx.c +++ b/net/ieee802154/6lowpan/tx.c @@ -255,7 +255,7 @@ static int lowpan_header(struct sk_buff *skb, struct net_device *ldev, netdev_tx_t lowpan_xmit(struct sk_buff *skb, struct net_device *ldev) { struct ieee802154_hdr wpan_hdr; - int max_single, ret; + int max_single; u16 dgram_size, dgram_offset; pr_debug("package xmit\n"); @@ -269,13 +269,8 @@ netdev_tx_t lowpan_xmit(struct sk_buff *skb, struct net_device *ldev) if (!skb) return NET_XMIT_DROP; - ret = lowpan_header(skb, ldev, &dgram_size, &dgram_offset); - if (ret < 0) { - kfree_skb(skb); - return NET_XMIT_DROP; - } - - if (ieee802154_hdr_peek(skb, &wpan_hdr) < 0) { + if (lowpan_header(skb, ldev, &dgram_size, &dgram_offset) < 0 || + ieee802154_hdr_peek(skb, &wpan_hdr) < 0) { kfree_skb(skb); return NET_XMIT_DROP; } -- 2.15.0