From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00, BUG6152_INVALID_DATE_TZ_ABSURD,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INVALID_DATE_TZ_ABSURD,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2117AC433E4 for ; Mon, 27 Jul 2020 13:20:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC2482074F for ; Mon, 27 Jul 2020 13:20:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Fm0myA6r"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="nn3Ccf0K" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726932AbgG0NUh (ORCPT ); Mon, 27 Jul 2020 09:20:37 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:55648 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726222AbgG0NUg (ORCPT ); Mon, 27 Jul 2020 09:20:36 -0400 From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1595856034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QEC599F9d5Phwiy4Paam7iRk0SAUOnpMx6pT2BgmNxk=; b=Fm0myA6rXHM1+w5H5Trz/8ZiYA4t4LwTwf3FmObzt0//Ux1ppnJ3+3ru6H28X//ryQBfJE gxKGnpQddqPor7JNsAbnDoNhVv6s/OiSWJZWy9q2nnCSUgDsEIVvP4vFcRrVGGv2sjxzZt 5BFYPzLGQnWER224YM0kqjXTAP36GmusLbBuvSvEJ3qgJPOM4Ox82WIyEo0KKCFywf7cZL zh+hSyrTXBNN8exMXahbqwdqWUq6IBYaip8svDt13x+YV8S5qt/UfXUf/oGIWw0o+QJLq+ BhshrPhcQsDnmjamN6XnIw/DC41qiyDqkduOURHZlFrLXiEzKvNUWN63Kte3dg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1595856034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QEC599F9d5Phwiy4Paam7iRk0SAUOnpMx6pT2BgmNxk=; b=nn3Ccf0KX4putGJjeUuJelLK04rIfaVzoa3gkLlqOlrBHwwfn0SbBMpekV1j9ylP2uhNWD I9jGD6aCGCFG1zCQ== To: Julia Lawall Cc: Sebastian Andrzej Siewior , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , linux-kernel@vger.kernel.org, kbuild-all@lists.01.org, linux-rt-users Subject: Re: [PATCH] printk: fix ifnullfree.cocci warnings In-Reply-To: References: Date: Mon, 27 Jul 2020 15:26:33 +0206 Message-ID: <87y2n53xi6.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-rt-users-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org On 2020-07-24, Julia Lawall wrote: > Make the code a little simpler by dropping > some unneeded tests. > > Generated by: scripts/coccinelle/free/ifnullfree.cocci > > Fixes: c406fbce2054 ("printk: implement syslog") > CC: John Ogness > Signed-off-by: kernel test robot This is for the rogue version of the printk ringbuffer within RT at the moment. Until the new accepted version is mainline, we might as well keep the RT variant maintained. Acked-by: John Ogness > --- > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-5.4.y-rt > head: 5fbf1e70f11dba64cc05c9d85120a3aa7c67a4a2 > commit: c406fbce2054efbf812b3d811ed23a872f719db9 [43/325] printk: implement syslog > :::::: branch date: 4 months ago > :::::: commit date: 7 months ago > > printk.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -1539,10 +1539,8 @@ static int syslog_print_all(char __user > if (clear && !seq) > syslog_clear(); > > - if (text) > - kfree(text); > - if (msgbuf) > - kfree(msgbuf); > + kfree(text); > + kfree(msgbuf); > return len; > } > > @@ -1695,10 +1693,8 @@ int do_syslog(int type, char __user *buf > break; > } > out: > - if (msgbuf) > - kfree(msgbuf); > - if (text) > - kfree(text); > + kfree(msgbuf); > + kfree(text); > return error; > } >