summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2009-04-02 23:57:27 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-03 02:04:54 (GMT)
commit66bdc9cfc77ba89a9ee6c82d28375b646ab4bb1d (patch)
treedd0d292a2f413f8c14d2219f8de94516fffe18b5
parentec64f51545fffbc4cb968f0cea56341a4b07e85a (diff)
downloadlinux-fsl-qoriq-66bdc9cfc77ba89a9ee6c82d28375b646ab4bb1d.tar.xz
kernel/cgroup.c: kfree(NULL) is legal
Reduces object file size a bit: Before: $ size kernel/cgroup.o text data bss dec hex filename 21593 7804 4924 34321 8611 kernel/cgroup.o After: $ size kernel/cgroup.o text data bss dec hex filename 21537 7744 4924 34205 859d kernel/cgroup.o Signed-off-by: Jesper Juhl <jj@chaosbits.net> Cc: Paul Menage <menage@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--kernel/cgroup.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index fc5e4a4..9a6c2bf 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -923,8 +923,7 @@ static int cgroup_remount(struct super_block *sb, int *flags, char *data)
if (opts.release_agent)
strcpy(root->release_agent_path, opts.release_agent);
out_unlock:
- if (opts.release_agent)
- kfree(opts.release_agent);
+ kfree(opts.release_agent);
mutex_unlock(&cgroup_mutex);
mutex_unlock(&cgrp->dentry->d_inode->i_mutex);
return ret;
@@ -1027,15 +1026,13 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
/* First find the desired set of subsystems */
ret = parse_cgroupfs_options(data, &opts);
if (ret) {
- if (opts.release_agent)
- kfree(opts.release_agent);
+ kfree(opts.release_agent);
return ret;
}
root = kzalloc(sizeof(*root), GFP_KERNEL);
if (!root) {
- if (opts.release_agent)
- kfree(opts.release_agent);
+ kfree(opts.release_agent);
return -ENOMEM;
}