From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx> Date: Wed, 8 Nov 2017 17:08:55 +0100 * Add jump targets so that a call of the function "rdev_unlock_llsec_table" is stored only once in these function implementations. * Replace four calls by goto statements. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx> --- net/ieee802154/nl802154.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index 99f6c254ea77..33865d355433 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1527,16 +1527,16 @@ nl802154_dump_llsec_key(struct sk_buff *skb, struct netlink_callback *cb) rdev, wpan_dev->netdev, key) < 0) { /* TODO */ err = -EIO; - rdev_unlock_llsec_table(rdev, wpan_dev); - goto out_err; + goto unlock_table; } } cb->args[2] = 1; out: - rdev_unlock_llsec_table(rdev, wpan_dev); err = skb->len; +unlock_table: + rdev_unlock_llsec_table(rdev, wpan_dev); out_err: nl802154_finish_wpan_dev_dump(rdev); @@ -1697,16 +1697,16 @@ nl802154_dump_llsec_dev(struct sk_buff *skb, struct netlink_callback *cb) rdev, wpan_dev->netdev, dev) < 0) { /* TODO */ err = -EIO; - rdev_unlock_llsec_table(rdev, wpan_dev); - goto out_err; + goto unlock_table; } } cb->args[2] = 1; out: - rdev_unlock_llsec_table(rdev, wpan_dev); err = skb->len; +unlock_table: + rdev_unlock_llsec_table(rdev, wpan_dev); out_err: nl802154_finish_wpan_dev_dump(rdev); @@ -1875,8 +1875,7 @@ nl802154_dump_llsec_devkey(struct sk_buff *skb, struct netlink_callback *cb) kpos) < 0) { /* TODO */ err = -EIO; - rdev_unlock_llsec_table(rdev, wpan_dev); - goto out_err; + goto unlock_table; } } } @@ -1884,8 +1883,9 @@ nl802154_dump_llsec_devkey(struct sk_buff *skb, struct netlink_callback *cb) cb->args[2] = 1; out: - rdev_unlock_llsec_table(rdev, wpan_dev); err = skb->len; +unlock_table: + rdev_unlock_llsec_table(rdev, wpan_dev); out_err: nl802154_finish_wpan_dev_dump(rdev); @@ -2034,16 +2034,16 @@ nl802154_dump_llsec_seclevel(struct sk_buff *skb, struct netlink_callback *cb) rdev, wpan_dev->netdev, sl) < 0) { /* TODO */ err = -EIO; - rdev_unlock_llsec_table(rdev, wpan_dev); - goto out_err; + goto unlock_table; } } cb->args[2] = 1; out: - rdev_unlock_llsec_table(rdev, wpan_dev); err = skb->len; +unlock_table: + rdev_unlock_llsec_table(rdev, wpan_dev); out_err: nl802154_finish_wpan_dev_dump(rdev); -- 2.15.0 -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html