* [PATCH iproute2-next] misc: ss.c: fix logical error in main function
@ 2025-07-19 16:31 Anton Moryakov
2025-07-20 15:15 ` Stephen Hemminger
2025-07-29 23:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Anton Moryakov @ 2025-07-19 16:31 UTC (permalink / raw)
To: netdev; +Cc: Anton Moryakov
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
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH iproute2-next] misc: ss.c: fix logical error in main function 2025-07-19 16:31 [PATCH iproute2-next] misc: ss.c: fix logical error in main function Anton Moryakov @ 2025-07-20 15:15 ` Stephen Hemminger 2025-07-29 23:30 ` patchwork-bot+netdevbpf 1 sibling, 0 replies; 3+ messages in thread From: Stephen Hemminger @ 2025-07-20 15:15 UTC (permalink / raw) To: Anton Moryakov; +Cc: netdev On Sat, 19 Jul 2025 19:31:22 +0300 Anton Moryakov <ant.v.moryakov@gmail.com> wrote: > 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> Acked-by: Stephen Hemminger <stephen@networkplumber.org> ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2-next] misc: ss.c: fix logical error in main function 2025-07-19 16:31 [PATCH iproute2-next] misc: ss.c: fix logical error in main function Anton Moryakov 2025-07-20 15:15 ` Stephen Hemminger @ 2025-07-29 23:30 ` patchwork-bot+netdevbpf 1 sibling, 0 replies; 3+ messages in thread From: patchwork-bot+netdevbpf @ 2025-07-29 23:30 UTC (permalink / raw) To: Anton Moryakov; +Cc: netdev Hello: This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <dsahern@kernel.org>: On Sat, 19 Jul 2025 19:31:22 +0300 you wrote: > 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> > > [...] Here is the summary with links: - [iproute2-next] misc: ss.c: fix logical error in main function https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=27d11a81197c You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-29 23:29 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-07-19 16:31 [PATCH iproute2-next] misc: ss.c: fix logical error in main function Anton Moryakov 2025-07-20 15:15 ` Stephen Hemminger 2025-07-29 23:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox