]> git.baikalelectronics.ru Git - kernel.git/commit
net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames
authorXie He <xie.he.0141@gmail.com>
Sat, 31 Oct 2020 18:10:39 +0000 (11:10 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 3 Nov 2020 23:19:09 +0000 (15:19 -0800)
commit17937e57f30dff770a67f827df29a004f0825a0a
tree3d1e75e2f95661afdf1a59ae466ffb4c66b0621a
parentc860c9809fcea676f9dc7ed2b047bb59811095f7
net: hdlc_fr: Simpify fr_rx by using "goto rx_drop" to drop frames

When the fr_rx function drops a received frame (because the protocol type
is not supported, or because the PVC virtual device that corresponds to
the DLCI number and the protocol type doesn't exist), the function frees
the skb and returns.

The code for freeing the skb and returning is repeated several times, this
patch uses "goto rx_drop" to replace them so that the code looks cleaner.

Cc: Krzysztof Halasa <khc@pm.waw.pl>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Signed-off-by: Xie He <xie.he.0141@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/wan/hdlc_fr.c