]> 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)
commita645ff8a099e84938f805c630feab1232a4e3ae3
tree3d1e75e2f95661afdf1a59ae466ffb4c66b0621a
parentaf5ef2a77681302c66744c6fc7017874797c7f26
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