Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a65914b3658043da27c159b8a28c5811bb0a88c9
Commit:     a65914b3658043da27c159b8a28c5811bb0a88c9
Parent:     8927f49479756c1aff76e8202ad32733c965864f
Author:     Ingo Molnar <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 15 17:00:13 2007 +0200
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Mon Oct 15 17:00:13 2007 +0200

    sched: kfree(NULL) is valid
    
    kfree(NULL) is valid.
    
    pointed out by checkpatch.pl.
    
    the fix shrinks the code a bit:
    
       text    data     bss     dec     hex filename
      40024    3842     100   43966    abbe sched.o.before
      40002    3842     100   43944    aba8 sched.o.after
    
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 kernel/sched.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 10b7bed..23da933 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6784,17 +6784,14 @@ struct task_grp *sched_create_group(void)
 
 err:
        for_each_possible_cpu(i) {
-               if (tg->cfs_rq && tg->cfs_rq[i])
+               if (tg->cfs_rq)
                        kfree(tg->cfs_rq[i]);
-               if (tg->se && tg->se[i])
+               if (tg->se)
                        kfree(tg->se[i]);
        }
-       if (tg->cfs_rq)
-               kfree(tg->cfs_rq);
-       if (tg->se)
-               kfree(tg->se);
-       if (tg)
-               kfree(tg);
+       kfree(tg->cfs_rq);
+       kfree(tg->se);
+       kfree(tg);
 
        return ERR_PTR(-ENOMEM);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-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