From: Anton Moryakov <ant.v.moryakov@gmail.com>
To: netdev@vger.kernel.org
Cc: Anton Moryakov <ant.v.moryakov@gmail.com>
Subject: [PATCH iproute2-next] misc: ss.c: fix logical error in main function
Date: Sat, 19 Jul 2025 19:31:22 +0300 [thread overview]
Message-ID: <20250719163122.51904-1-ant.v.moryakov@gmail.com> (raw)
In the line if (!dump_tcpdiag) { there was a logical error
in checking the descriptor, which the static analyzer complained
about (this action is always false)
fixed by replacing !dump_tcpdiag with !dump_fp
Reported-by: SVACE static analyzer
Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
---
misc/ss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/misc/ss.c b/misc/ss.c
index de02fccb..20d0766d 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -6228,7 +6228,7 @@ int main(int argc, char *argv[])
}
if (dump_tcpdiag[0] != '-') {
dump_fp = fopen(dump_tcpdiag, "w");
- if (!dump_tcpdiag) {
+ if (!dump_fp) {
perror("fopen dump file");
exit(-1);
}
--
2.39.2
next reply other threads:[~2025-07-19 16:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-19 16:31 Anton Moryakov [this message]
2025-07-20 15:15 ` [PATCH iproute2-next] misc: ss.c: fix logical error in main function Stephen Hemminger
2025-07-29 23:30 ` patchwork-bot+netdevbpf
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=20250719163122.51904-1-ant.v.moryakov@gmail.com \
--to=ant.v.moryakov@gmail.com \
--cc=netdev@vger.kernel.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