From: Ingo Molnar Date: Mon, 15 Oct 2007 15:00:13 +0000 (+0200) Subject: sched: kfree(NULL) is valid X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a65914b3658043da27c159b8a28c5811bb0a88c9;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git 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 --- diff --git a/kernel/sched.c b/kernel/sched.c index 10b7bedfa35a..23da93360b22 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); }