ChangeSet 1.2217.1.19, 2005/03/16 20:57:52-08:00, [EMAIL PROTECTED]

        [IPV6]: Remove redundant NULL checks before kfree
        
        I don't mind calling kfree twice itself (because that function is not
        so performance critical), but fl_free(NULL) is out because
        if fl is NULL, kfree(fl->opt) is out.
        
        So, what do you think of checking fl inside fl_free like this?
        
        Based on patch from Jesper Juhl <[EMAIL PROTECTED]>.
        
        Signed-off-by: Hideaki YOSHIFUJI <[EMAIL PROTECTED]>
        Signed-off-by: David S. Miller <[EMAIL PROTECTED]>



 ip6_flowlabel.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)


diff -Nru a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
--- a/net/ipv6/ip6_flowlabel.c  2005-03-18 14:07:11 -08:00
+++ b/net/ipv6/ip6_flowlabel.c  2005-03-18 14:07:11 -08:00
@@ -87,7 +87,7 @@
 
 static void fl_free(struct ip6_flowlabel *fl)
 {
-       if (fl->opt)
+       if (fl)
                kfree(fl->opt);
        kfree(fl);
 }
@@ -351,8 +351,7 @@
        return fl;
 
 done:
-       if (fl)
-               fl_free(fl);
+       fl_free(fl);
        *err_p = err;
        return NULL;
 }
@@ -551,10 +550,8 @@
        }
 
 done:
-       if (fl)
-               fl_free(fl);
-       if (sfl1)
-               kfree(sfl1);
+       fl_free(fl);
+       kfree(sfl1);
        return err;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to