diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 9bf5404397e0b224873456617437fc172617a637..06045abd188774565ca688a2a13135cf5241240b 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -1048,7 +1048,12 @@ static void __init log_buf_len_update(unsigned size) /* save requested log_buf_len since it's too early to process it */ static int __init log_buf_len_setup(char *str) { - unsigned size = memparse(str, &str); + unsigned int size; + + if (!str) + return -EINVAL; + + size = memparse(str, &str); log_buf_len_update(size);