[Openvpn-devel,v1] mtcp: Remove noop statement in multi_tcp_process_outgoing_link_ready

Message ID 20260404203335.30650-1-gert@greenie.muc.de
State New
Headers show
Series [Openvpn-devel,v1] mtcp: Remove noop statement in multi_tcp_process_outgoing_link_ready | expand

Commit Message

Gert Doering April 4, 2026, 8:33 p.m. UTC
From: Frank Lichtenheld <frank@lichtenheld.com>

Assigning to a parameter here has no effect. I can see no
obvious alternative statement that might have been intended.

Found by cppcheck.

Change-Id: I04a01cf536ee6d48d54ba623dda460c4a98859f9
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1609
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1609
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <gert@greenie.muc.de>

Comments

Gert Doering April 5, 2026, 10:28 a.m. UTC | #1
Another good catch :-) - and indeed, stare-at-code confirms your and
cppcheck's analysis.  Dead code.  From the dark times.  As for the last
patch, "master only" unless we want release/2.7 to be cppcheck-clean.

Your patch has been applied to the master branch.

commit d44ed886c279de51a936cc0652c9b72c943a6558
Author: Frank Lichtenheld
Date:   Sat Apr 4 22:33:30 2026 +0200

     mtcp: Remove noop statement in multi_tcp_process_outgoing_link_ready

     Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1609
     Message-Id: <20260404203335.30650-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36478.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/mtcp.c b/src/openvpn/mtcp.c
index 2eab7b7..7651b4d 100644
--- a/src/openvpn/mtcp.c
+++ b/src/openvpn/mtcp.c
@@ -155,10 +155,6 @@ 
         ASSERT(mi == item.instance);
         mi->context.c2.to_link = item.buffer->buf;
         ret = multi_process_outgoing_link_dowork(m, mi, mpp_flags);
-        if (!ret)
-        {
-            mi = NULL;
-        }
         mbuf_free_buf(item.buffer);
     }
     return ret;