Skip to content

Commit 9b5f059

Browse files
committed
xdp-dump: Don't pass fd to strerror
Coverity points out that we pass a negative value to strerror in the error path in xdpdump. We really should be passing errno anyway, not the return value, so fix this to use the right value. Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
1 parent e3e7087 commit 9b5f059

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xdp-dump/xdpdump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,7 @@ static bool load_xdp_trace_program(struct dumpopt *cfg,
15891589
fd = bpf_map__fd(perf_map);
15901590
if (fd < 0) {
15911591
pr_warn("ERROR: Can't get xdpdump_perf_map file descriptor: %s\n",
1592-
strerror(fd));
1592+
strerror(errno));
15931593

15941594
xdp_program__detach(prog, cfg->iface.ifindex,
15951595
cfg->load_xdp_mode, 0);

0 commit comments

Comments
 (0)