| Message ID | 20260513090703.700837-1-a@unstable.cc |
|---|---|
| State | New |
| Headers | show
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net>
Delivered-To: patchwork@openvpn.net
Received: by 2002:a05:7000:a719:b0:84a:48f:a1fd with SMTP id
hl25csp3022729mab;
Wed, 13 May 2026 02:07:47 -0700 (PDT)
X-Forwarded-Encrypted: i=2;
AFNElJ+fpPZpvB6usqfBmvtEoJX9HAIwYeNssZino//O2F4Hp86dG4Te9knmebU6GX6caZ0K0edzQVpYA4U=@openvpn.net
X-Received: by 2002:a05:6820:4c87:b0:694:9707:4e59 with SMTP id
006d021491bc7-69b78e3098bmr1347221eaf.46.1778663267093;
Wed, 13 May 2026 02:07:47 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1778663267; cv=none;
d=google.com; s=arc-20240605;
b=UpeYCGoWZM7/FJ2rEHNPCkR/AqWSrsR9DPyNDN6MNx3qBDp0ERNjFTnVEwCg1XZykU
MBPhNbHRbFSlK6lPQU5TlWZf04s4GoC23+avk8HQcYjKf0xuZatjz45Z+E0ot96xN+sn
oO3mrkJWGvBh73pCbz1L4Oedk3BFM5+39574IYK3UbLSxeGD9P5H6IeaHxiUVhFl52dC
IcZKE2RwBHFIJ+jNtvPozF8nmqZaSsZ/d7S52Oe6SUBQOI72DF2sISO+wqyW6RWVLlDy
hMRLqtcP5RZenEYFWkFiBg3vgyVqEsd1DqZLzuaTY8agxsFli3id8I1CsqxK0Ev8cHZP
woUg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=errors-to:content-transfer-encoding:cc:list-subscribe:list-help
:list-post:list-archive:list-unsubscribe:list-id:precedence:subject
:mime-version:message-id:date:to:from:dkim-signature:dkim-signature
:dkim-signature:dkim-signature;
bh=c/Rd//P4XKirhJ0vmlwKHoSkR68bdiUM2qjJb/RN0/8=;
fh=/DoErzaDfV7D5d1HTuqbHEeLtJaHnageexPDUcFwzk4=;
b=fqduN3BZs7CQDad2oPt++hJxUFIFjb67DvYNPurOyH2zitvpktxauQ1i2GbENG2BPz
KtiZu2WLuIf0LRDy45LkRLGqIhkTuPX/rE/EC1R4GPXazbldOMQjkmsLFutK8pLBhsLE
N82Ax8N4KH1QV8fPy3QB/j5qz35m7jvhooFDGQczW7FyJbDz8rX/rL3/B2uM5vTjcPBM
84ckjPnjs3Eb2texg3ccL31fuV7MmAYcLOe/QVPz2+RkTgdn77acPlS6YSGGrVKWaHxQ
t4Eq15RA8DbLgcnZKJzYYTv8MIXWvNQm4tqCs8+OkZGwD5zKjiIEUkFf92m7u8bmy6cl
05GQ==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=UU4EDIVi;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=DmZgiToD;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=ZqpekDmF;
dkim=neutral (body hash did not verify) header.i=@unstable.cc
header.s=MBO0001 header.b=ONCmdbAc;
spf=pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net
Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7])
by mx.google.com with ESMTPS id
006d021491bc7-69b25ca94b8si8292483eaf.40.2026.05.13.02.07.46
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Wed, 13 May 2026 02:07:47 -0700 (PDT)
Received-SPF: pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) client-ip=216.105.38.7;
Authentication-Results: mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=UU4EDIVi;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=DmZgiToD;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=ZqpekDmF;
dkim=neutral (body hash did not verify) header.i=@unstable.cc
header.s=MBO0001 header.b=ONCmdbAc;
spf=pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc:
List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:
Subject:MIME-Version:Message-ID:Date:To:From:Sender:Reply-To:Content-ID:
Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
:Resent-Message-ID:In-Reply-To:References:List-Owner;
bh=c/Rd//P4XKirhJ0vmlwKHoSkR68bdiUM2qjJb/RN0/8=; b=UU4EDIViqhmQKH2ED9mpGTC4AA
KQ0uQmvP6C1mGaWCDMSCZsHUC3tbOqz+MgN8WXkPqbbMEL2rSxgS5of6x2Tv2ovPVrCe/z0LelgkX
7Y5NGUU09kLD/HMmw98JXosX6MBOreboOQTdHPa1xCVf6ONDc+uF846FSJz5+4AW13As=;
Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com)
by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95)
(envelope-from <openvpn-devel-bounces@lists.sourceforge.net>)
id 1wN5ZB-0007rw-3c;
Wed, 13 May 2026 09:07:42 +0000
Received: from [172.30.29.66] (helo=mx.sourceforge.net)
by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95)
(envelope-from <a@unstable.cc>) id 1wN5Yr-0007r9-MD
for openvpn-devel@lists.sourceforge.net;
Wed, 13 May 2026 09:07:23 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-ID:
Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:
Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:
List-Subscribe:List-Post:List-Owner:List-Archive;
bh=Ia9PZH+qV/Xqk7xjBUDF1zydfLjRZfH8uAeFN9Od6hE=; b=DmZgiToDsu6k6d/EEEJn//oc4J
cdQBEwk3wX+9CU0Ulkve1mYWYJZp1TCGr+O4JEmUv5PtUv4D4weV/0V/Mp4qMEI1W7lKBgV4U59xH
xs9OW7fp/tvXIFw0LWy9TFofAvTkDPAp5Snmv/8/wgk7wfGY09zGugn7yFw0HDzKRbXY=;
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x
;
h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From
:Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:
Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:
References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:
List-Owner:List-Archive; bh=Ia9PZH+qV/Xqk7xjBUDF1zydfLjRZfH8uAeFN9Od6hE=; b=Z
qpekDmF6B6NGTrZqoqVNWj8gP4p1aaTnjzwYyDitDPXOz2gVgbj1BsG99SjDGqzlbDajVZfFFddO8
KpniAzSQt8qfjO8Zw0Pe9uzAJ7Wb/J+I64mDLJTniIB5nuHLaZOOWWDMqgHQBZCc3zOpaat0S4BR9
k1lOrJ9U8RFStQLc=;
Received: from mout-p-201.mailbox.org ([80.241.56.171])
by sfi-mx-2.v28.lw.sourceforge.com with esmtps
(TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95)
id 1wN5Yl-0003LH-Uf for openvpn-devel@lists.sourceforge.net;
Wed, 13 May 2026 09:07:23 +0000
Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest
SHA256)
(No client certificate requested)
by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4gFnf32wLNz9vFd;
Wed, 13 May 2026 11:07:07 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unstable.cc;
s=MBO0001;
t=1778663227;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:cc:mime-version:mime-version:
content-transfer-encoding:content-transfer-encoding;
bh=Ia9PZH+qV/Xqk7xjBUDF1zydfLjRZfH8uAeFN9Od6hE=;
b=ONCmdbAclc0glsntiq5cOj9DkKfxEb3EKrIWAzPUOP64GjOqL/MEY6DOu/7Q/t0aAMR5Ip
zRLnDO8hqOhVtwWyX0QUMW++pDsuqDOSDjmK+A1lYjNFWy9xKd9JIGjarLPGTy2yG2ROF6
FnfXw1nc8EyNwKvtpxgfIwlP9qyFkdYX1j9KxgIK41Kyflgz+9gyLNkulGs61KQSVh+wBv
zOM2kdw0NTeFOCRtSckmceNXC14/m6UG96lyfwB6WRrX051Hu36n3V9HU4OHOlr7Awd62/
WhjVYNvbOs4i/Yh5y+jEkqx8xa6YfbMBJt7ZP1A9ESI+WZZAwxrE0r54YRYpDg==
From: Antonio Quartulli <a@unstable.cc>
To: openvpn-devel@lists.sourceforge.net
Date: Wed, 13 May 2026 11:07:03 +0200
Message-ID: <20260513090703.700837-1-a@unstable.cc>
MIME-Version: 1.0
X-Spam-Score: -0.2 (/)
X-Spam-Report: Spam detection software,
running on the system "sfi-spamd-1.hosts.colo.sdot.me",
has NOT identified this incoming email as spam. The original
message has been attached to this so you can view it or label
similar future email. If you have any questions, see
the administrator of that system for details.
Content preview: From: Antonio Quartulli <antonio@openvpn.net> `peer` and
`ks`
are assumed to be non-NULL throughtout the whole ovpn_decrypt/encrypt_post(),
therefore it doesn't make sense to perform a NULL check before dropping their
reference.
Content analysis details: (-0.2 points, 5.0 required)
pts rule name description
---- ----------------------
--------------------------------------------------
-0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from
envelope-from domain
-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
domain
-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
0.1 DKIM_SIGNED Message has a DKIM or DK signature,
not necessarily valid
X-Headers-End: 1wN5Yl-0003LH-Uf
Subject: [Openvpn-devel] [PATCH ovpn net-next] ovpn: drop useless NULL
checks in ovpn_decrypt/encrypt_post()
X-BeenThere: openvpn-devel@lists.sourceforge.net
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <openvpn-devel.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive:
<http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel>
List-Post: <mailto:openvpn-devel@lists.sourceforge.net>
List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe>
Cc: Antonio Quartulli <antonio@openvpn.net>, Dan Carpenter <error27@gmail.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: openvpn-devel-bounces@lists.sourceforge.net
X-getmail-retrieved-from-mailbox: Inbox
X-GMAIL-THRID: =?utf-8?q?1865063614118773291?=
X-GMAIL-MSGID: =?utf-8?q?1865063614118773291?=
|
| Series |
[Openvpn-devel,ovpn,net-next] ovpn: drop useless NULL checks in ovpn_decrypt/encrypt_post()
|
expand
|
diff --git a/drivers/net/ovpn/io.c b/drivers/net/ovpn/io.c index 3e6c06b9a5ae..762a8f31acfa 100644 --- a/drivers/net/ovpn/io.c +++ b/drivers/net/ovpn/io.c @@ -198,10 +198,8 @@ void ovpn_decrypt_post(void *data, int ret) dev_dstats_rx_dropped(peer->ovpn->dev); kfree_skb(skb); drop_nocount: - if (likely(peer)) - ovpn_peer_put(peer); - if (likely(ks)) - ovpn_crypto_key_slot_put(ks); + ovpn_peer_put(peer); + ovpn_crypto_key_slot_put(ks); } /* RX path entry point: decrypt packet and forward it to the device */ @@ -296,10 +294,8 @@ void ovpn_encrypt_post(void *data, int ret) err: if (unlikely(skb)) dev_dstats_tx_dropped(peer->ovpn->dev); - if (likely(peer)) - ovpn_peer_put(peer); - if (likely(ks)) - ovpn_crypto_key_slot_put(ks); + ovpn_peer_put(peer); + ovpn_crypto_key_slot_put(ks); kfree_skb(skb); }