From dbebc0a7cced1ae61b5e6b0cd2be9462fbe14c15 Mon Sep 17 00:00:00 2001 From: hasslesstech Date: Tue, 17 Dec 2024 21:54:21 +0200 Subject: [PATCH] change behaviour on too large argument --- hello2.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hello2.c b/hello2.c index 5315fc0..fe10d0b 100644 --- a/hello2.c +++ b/hello2.c @@ -44,10 +44,7 @@ static unsigned int msg_count = 1; static int __init hello_init(void) { - if (msg_count > 10) { - pr_err("Error: msg_count too large (%d > 10)\n", msg_count); - return -EINVAL; - } + BUG_ON(msg_count > 10); if (msg_count == 0 || msg_count >= 5) pr_warn("Warning: msg_count = %d (msg_count == 0 or 5 <= msg_count <= 10)\n", msg_count);