Re: [PATCH] printk: remove unnecessary kmalloc() from syslog during clear

From: Jiri Kosina
Date: Mon Jun 25 2018 - 09:45:05 EST


On Mon, 25 Jun 2018, Petr Mladek wrote:

> @@ -1426,7 +1428,8 @@ static int syslog_print_all(char __user *buf, int size, bool clear)
> }
> logbuf_unlock_irq();
>
> - kfree(text);
> + if (text)
> + kfree(text);

Nit: you don't need to duplicate the check kfree() is doing anyway.

--
Jiri Kosina
SUSE Labs