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)
commit583d5333ed7dcdc0c7a3f8ec8b818b7ae4a59e8e
tree3d1e75e2f95661afdf1a59ae466ffb4c66b0621a
parent16b5f5ce351f8709a6b518cc3cbf240c378305bf
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