Commit a65914b3 authored by Ingo Molnar's avatar Ingo Molnar

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: default avatarIngo Molnar <mingo@elte.hu>
parent 8927f494
...@@ -6784,16 +6784,13 @@ struct task_grp *sched_create_group(void) ...@@ -6784,16 +6784,13 @@ struct task_grp *sched_create_group(void)
err: err:
for_each_possible_cpu(i) { for_each_possible_cpu(i) {
if (tg->cfs_rq && tg->cfs_rq[i]) if (tg->cfs_rq)
kfree(tg->cfs_rq[i]); kfree(tg->cfs_rq[i]);
if (tg->se && tg->se[i]) if (tg->se)
kfree(tg->se[i]); kfree(tg->se[i]);
} }
if (tg->cfs_rq)
kfree(tg->cfs_rq); kfree(tg->cfs_rq);
if (tg->se)
kfree(tg->se); kfree(tg->se);
if (tg)
kfree(tg); kfree(tg);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment