netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: [conntrack-tools PATCH 2/4] conntrack: Fix for unused assignment in do_command_ct()
Date: Tue, 20 Dec 2022 16:38:45 +0100	[thread overview]
Message-ID: <20221220153847.24152-3-phil@nwl.cc> (raw)
In-Reply-To: <20221220153847.24152-1-phil@nwl.cc>

The variable is overwritten immediately in the next iteration and the
loop can't exit before doing that.

Instead of dropping the assignment, one could add a return code check -
but since event_cb() never fails, that check is pointless as well.

Fixes: e0dac21ed02e3 ("conntrack: use libmnl for conntrack events")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 src/conntrack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conntrack.c b/src/conntrack.c
index aa6323dfbd1b1..07fae3dc2ff07 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -3479,7 +3479,7 @@ static int do_command_ct(const char *progname, struct ct_cmd *cmd,
 					   strerror(errno));
 				break;
 			}
-			res = mnl_cb_run(buf, res, 0, 0, event_cb, cmd);
+			mnl_cb_run(buf, res, 0, 0, event_cb, cmd);
 		}
 		mnl_socket_close(event_sock->mnl);
 		break;
-- 
2.38.0


  parent reply	other threads:[~2022-12-20 15:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-20 15:38 [conntrack-tools PATCH 0/4] Fix some minor bugs Phil Sutter
2022-12-20 15:38 ` [conntrack-tools PATCH 1/4] conntrack: Fix potential array out of bounds access Phil Sutter
2022-12-20 15:38 ` Phil Sutter [this message]
2022-12-20 15:38 ` [conntrack-tools PATCH 3/4] conntrack: Fix for unused assignment in ct_save_snprintf() Phil Sutter
2022-12-20 15:38 ` [conntrack-tools PATCH 4/4] conntrack: Sanitize free_tmpl_objects() Phil Sutter
2022-12-21 16:48 ` [conntrack-tools PATCH 0/4] Fix some minor bugs Pablo Neira Ayuso
2022-12-21 16:51   ` Phil Sutter

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=20221220153847.24152-3-phil@nwl.cc \
    --to=phil@nwl.cc \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /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;
as well as URLs for NNTP newsgroup(s).