printk: fix ifnullfree.cocci warnings
PATCH 1/1 printk: fix ifnullfree.cocci warnings
Make the code a little simpler by dropping
some unneeded tests.
Generated by: scripts/coccinelle/free/ifnullfree.cocci
---
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(-)
kernel/printk/printk.c +4 -8
@@ -1539,10 +1539,8 @@ static int syslog_print_all(char __userif (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 *bufbreak ; } out: -if (msgbuf) -kfree (msgbuf); -if (text) -kfree (text); +kfree (msgbuf); +kfree (text);return error; }
Quoted 8 lines · Julia Lawall
Make the code a little simpler by dropping
some unneeded tests.Generated by:
scripts/coccinelle/free/ifnullfree.cocciFixes c406fbce2054 ("printk: implement syslog")CC John Ogness <[email protected]>Signed-off-by kernel test robot <[email protected]>
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.
Quoted 39 lines
---
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 agoprintk.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)kernel/printk/printk.c +4
-8@@ -1539,10 +1539,8 @@ static int syslog_print_all(char __userif (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 *bufbreak ; } out: -if (msgbuf) -kfree (msgbuf); -if (text) -kfree (text); +kfree (msgbuf); +kfree (text);return error; }
Sebastian Andrzej Siewior
AppliedQuoted 10 lines · John Ogness
Quoted 8 lines · Julia Lawall
Make the code a little simpler by dropping
some unneeded tests.Generated by:
scripts/coccinelle/free/ifnullfree.cocciFixes c406fbce2054 ("printk: implement syslog")CC John Ogness <[email protected]>Signed-off-by kernel test robot <[email protected]>
Quoted 5 lines
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 <[email protected]>
Applied.
Sebastian