Linux PPP protocol development
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: linux-ppp@vger.kernel.org, netdev@vger.kernel.org,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Breno Leitao <leitao@debian.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Norbert Szetei <norbert@doyensec.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Qingfang Deng <qingfang.deng@linux.dev>
Cc: LKML <linux-kernel@vger.kernel.org>, Kees Cook <kees@kernel.org>
Subject: [PATCH net-next] ppp: Use common code in ppp_push()
Date: Mon, 7 Sep 2026 21:43:31 +0200	[thread overview]
Message-ID: <3a1f99f3-77c7-475c-bc2a-3eb764cfe77b@web.de> (raw)

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


                 reply	other threads:[~2026-09-07 19:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3a1f99f3-77c7-475c-bc2a-3eb764cfe77b@web.de \
    --to=markus.elfring@web.de \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kees@kernel.org \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ppp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=norbert@doyensec.com \
    --cc=pabeni@redhat.com \
    --cc=qingfang.deng@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox