Skip to content

Commit

Permalink
bpf: Fix a warning message in mark_ptr_not_null_reg()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Dan Carpenter authored and borkmann committed Feb 17, 2021
1 parent 89e45c5 commit 7b1e385
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/bpf/verifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ static void mark_ptr_not_null_reg(struct bpf_reg_state *reg)
reg->type = PTR_TO_RDWR_BUF;
break;
default:
WARN_ON("unknown nullable register type");
WARN_ONCE(1, "unknown nullable register type");
}
}

Expand Down

0 comments on commit 7b1e385

Please sign in to comment.