diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-04-28 17:13:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 20:29:18 -0400 |
commit | b331d259b1147f82d692f3b866e036017cbde8fe (patch) | |
tree | db8de3a81e63c97c778b950dc6221458df6e6988 | |
parent | d613c3e2d841889f32b1e74f251a6a6bcd9642cf (diff) |
kernel: fix integer as NULL pointer warnings
kernel/cpuset.c:1268:52: warning: Using plain integer as NULL pointer
kernel/pid_namespace.c:95:24: warning: Using plain integer as NULL pointer
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Reviewed-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | kernel/cpuset.c | 3 | ||||
-rw-r--r-- | kernel/pid_namespace.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 024888bb9814..48a976c52cf5 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -1265,7 +1265,8 @@ static ssize_t cpuset_common_file_write(struct cgroup *cont, | |||
1265 | return -E2BIG; | 1265 | return -E2BIG; |
1266 | 1266 | ||
1267 | /* +1 for nul-terminator */ | 1267 | /* +1 for nul-terminator */ |
1268 | if ((buffer = kmalloc(nbytes + 1, GFP_KERNEL)) == 0) | 1268 | buffer = kmalloc(nbytes + 1, GFP_KERNEL); |
1269 | if (!buffer) | ||
1269 | return -ENOMEM; | 1270 | return -ENOMEM; |
1270 | 1271 | ||
1271 | if (copy_from_user(buffer, userbuf, nbytes)) { | 1272 | if (copy_from_user(buffer, userbuf, nbytes)) { |
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c index 6d792b66d854..5ca37fa50beb 100644 --- a/kernel/pid_namespace.c +++ b/kernel/pid_namespace.c | |||
@@ -92,7 +92,7 @@ static struct pid_namespace *create_pid_namespace(int level) | |||
92 | atomic_set(&ns->pidmap[0].nr_free, BITS_PER_PAGE - 1); | 92 | atomic_set(&ns->pidmap[0].nr_free, BITS_PER_PAGE - 1); |
93 | 93 | ||
94 | for (i = 1; i < PIDMAP_ENTRIES; i++) { | 94 | for (i = 1; i < PIDMAP_ENTRIES; i++) { |
95 | ns->pidmap[i].page = 0; | 95 | ns->pidmap[i].page = NULL; |
96 | atomic_set(&ns->pidmap[i].nr_free, BITS_PER_PAGE); | 96 | atomic_set(&ns->pidmap[i].nr_free, BITS_PER_PAGE); |
97 | } | 97 | } |
98 | 98 | ||