mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next] ppp: Use common code in ppp_push()
@ 2026-09-07 19:43 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2026-09-07 19:43 UTC (permalink / raw)
  To: linux-ppp, netdev, Andrew Lunn, Breno Leitao, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Norbert Szetei, Paolo Abeni,
	Qingfang Deng
  Cc: LKML, Kees Cook

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 7 Sep 2026 21:32:36 +0200

Use an additional label so that two common statements can be better reused
at the end of this function implementation.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/net/ppp/ppp_generic.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index 1a610a18893b..6cb1d4cecce9 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -1908,11 +1908,9 @@ ppp_push(struct ppp *ppp, struct sk_buff *skb)
 	struct channel *pch;
 
 	list = &ppp->channels;
-	if (list_empty(list)) {
+	if (list_empty(list))
 		/* nowhere to send the packet, just drop it */
-		kfree_skb(skb);
-		return 1;
-	}
+		goto free_skb;
 
 	if ((ppp->flags & SC_MULTILINK) == 0) {
 		struct ppp_channel *chan;
@@ -1946,6 +1944,7 @@ ppp_push(struct ppp *ppp, struct sk_buff *skb)
 		return 0;
 #endif /* CONFIG_PPP_MULTILINK */
 
+free_skb:
 	kfree_skb(skb);
 	return 1;
 }
-- 
2.55.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-07 19:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-07 19:43 [PATCH net-next] ppp: Use common code in ppp_push() Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®