diff mbox series

[v2,bpf-next] bpf: fix a warning message in mark_ptr_not_null_reg()

Message ID YCzJlV3hnF/t1Pk4@mwanda (mailing list archive)
State Accepted
Commit 7b1e385c9a488de9291eaaa412146d3972e9dec5
Delegated to: BPF
Headers show
Series [v2,bpf-next] bpf: fix a warning message in mark_ptr_not_null_reg() | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for bpf-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 1 maintainers not CCed: netdev@vger.kernel.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 17 this patch: 17
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 17 this patch: 17
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Dan Carpenter Feb. 17, 2021, 7:45 a.m. UTC
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: 4ddb74165ae5 ("bpf: Extract nullable reg type conversion into a helper function")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2:  Use WARN_ONCE().

 kernel/bpf/verifier.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 17, 2021, 10:10 p.m. UTC | #1
Hello:

This patch was applied to bpf/bpf-next.git (refs/heads/master):

On Wed, 17 Feb 2021 10:45:25 +0300 you wrote:
> 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: 4ddb74165ae5 ("bpf: Extract nullable reg type conversion into a helper function")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> [...]

Here is the summary with links:
  - [v2,bpf-next] bpf: fix a warning message in mark_ptr_not_null_reg()
    https://git.kernel.org/bpf/bpf-next/c/7b1e385c9a48

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 1dda9d81f12c..3d34ba492d46 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -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");
 	}
 }