lkml.org 
[lkml]   [2018]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] printk: remove unnecessary kmalloc() from syslog during clear
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

\
 
 \ /
  Last update: 2018-06-25 15:46    [W:1.441 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site