drivers/net/wan/hdlc_fr: Improvements to the code of pvc_xmit
authorXie He <xie.he.0141@gmail.com>
Sat, 3 Oct 2020 22:41:05 +0000 (15:41 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 4 Oct 2020 22:11:35 +0000 (15:11 -0700)
commitf5083d0cee08a4b87d5d7a5c57f60ec128bff997
tree469dafc9a9baa4e0675a120c510c4868f13c170d
parent3e233cac4278366547fad3176ecf3d8d5944e2ea
drivers/net/wan/hdlc_fr: Improvements to the code of pvc_xmit

1. Keep the code for the normal (non-error) flow at the lowest
indentation level. And use "goto drop" for all error handling.

2. Replace code that pads short Ethernet frames with a "__skb_pad" call.

3. Change "dev_kfree_skb" to "kfree_skb" in error handling code.
"kfree_skb" is the correct function to call when dropping an skb due to
an error. "dev_kfree_skb", which is an alias of "consume_skb", is for
dropping skbs normally (not due to an error).

Cc: Krzysztof Halasa <khc@pm.waw.pl>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Xie He <xie.he.0141@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wan/hdlc_fr.c