Skip to content

Commit 59010ad

Browse files
adrianreberavagin
authored andcommitted
net: Argument cannot be negative (NEGATIVE_RETURNS)
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 <[email protected]>
1 parent 82cd3bb commit 59010ad

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

criu/net.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1915,7 +1915,12 @@ static inline int dump_nftables(struct cr_imgset *fds)
19151915
return -1;
19161916

19171917
img = img_from_set(fds, CR_FD_NFTABLES);
1918-
img_fd = dup(img_raw_fd(img));
1918+
img_fd = img_raw_fd(img);
1919+
if (img_fd < 0) {
1920+
pr_err("Getting raw FD failed\n");
1921+
goto nft_ctx_free_out;
1922+
}
1923+
img_fd = dup(img_fd);
19191924
if (img_fd < 0) {
19201925
pr_perror("dup() failed");
19211926
goto nft_ctx_free_out;

0 commit comments

Comments
 (0)