Skip to content

Commit

Permalink
net: Argument cannot be negative (NEGATIVE_RETURNS)
Browse files Browse the repository at this point in the history
CID 192961 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
 sockfd 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 5631e9d commit 4a77e04
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions criu/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -2084,6 +2084,10 @@ static int restore_ip_dump(int type, int pid, char *cmd)
return 0;
}
sockfd = img_raw_fd(img);
if (sockfd < 0) {
pr_err("Getting raw FD failed\n");
return -1;
}
tmp_file = tmpfile();
if (!tmp_file) {
pr_perror("Failed to open tmpfile");
Expand Down

0 comments on commit 4a77e04

Please sign in to comment.