lkml.org 
[lkml]   [2014]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] kernel-audit: Deletion of an unnecessary check before the function call "audit_log_end"
On Sun, Nov 16, 2014 at 12:48:37PM +0100, SF Markus Elfring wrote:
> > An example of a bug introduced is here:
> >
> > https://lkml.org/lkml/2014/11/3/505
>
> It seems that we try to clarify a different interpretation of "bugs", don't we?
>

You removed the statement from "if (foo) kfree_fsm(foo);" so now it
prints a warning.

drivers/s390/net/fsm.c
71 void
72 kfree_fsm(fsm_instance *this)
73 {
74 if (this) {
75 if (this->f) {
76 kfree(this->f->jumpmatrix);
77 kfree(this->f);
78 }
79 kfree(this);
80 } else
81 printk(KERN_WARNING
82 "fsm: kfree_fsm called with NULL argument\n");
83 }

> It is an usual software development challenge to decide on the best source code places
> where to put input parameter validation (and when it can be omitted), isn't it?

No, it's not. You should just try to write the most readable software
you can instead of removing if statements because you can.

But that's not my point. My point is that these patches are not always
welcome so we should not merge them through the trivial tree.

regards,
dan carpenter


\
 
 \ /
  Last update: 2014-11-17 09:01    [W:0.675 / U:0.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site