Skip to content

Commit 7b1e385

Browse files
Dan Carpenterborkmann
authored andcommitted
bpf: Fix a warning message in mark_ptr_not_null_reg()
The WARN_ON() argument is a condition, not an error message. So this code will print a stack trace but will not print the warning message. Fix that and also change it to only WARN_ONCE(). Fixes: 4ddb741 ("bpf: Extract nullable reg type conversion into a helper function") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/YCzJlV3hnF%2Ft1Pk4@mwanda
1 parent 89e45c5 commit 7b1e385

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/bpf/verifier.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ static void mark_ptr_not_null_reg(struct bpf_reg_state *reg)
11201120
reg->type = PTR_TO_RDWR_BUF;
11211121
break;
11221122
default:
1123-
WARN_ON("unknown nullable register type");
1123+
WARN_ONCE(1, "unknown nullable register type");
11241124
}
11251125
}
11261126

0 commit comments

Comments
 (0)