Skip to content

Commit

Permalink
net: Argument cannot be negative (NEGATIVE_RETURNS)
Browse files Browse the repository at this point in the history
CID 302719 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)

 img_raw_fd(img) is passed to a parameter that cannot be negative.

Signed-off-by: Adrian Reber <areber@redhat.com>
  • Loading branch information
adrianreber authored and avagin committed Oct 20, 2020
1 parent 82cd3bb commit 59010ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion criu/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1915,7 +1915,12 @@ static inline int dump_nftables(struct cr_imgset *fds)
return -1;

img = img_from_set(fds, CR_FD_NFTABLES);
img_fd = dup(img_raw_fd(img));
img_fd = img_raw_fd(img);
if (img_fd < 0) {
pr_err("Getting raw FD failed\n");
goto nft_ctx_free_out;
}
img_fd = dup(img_fd);
if (img_fd < 0) {
pr_perror("dup() failed");
goto nft_ctx_free_out;
Expand Down

0 comments on commit 59010ad

Please sign in to comment.