Skip to content

Commit

Permalink
kernel: fix integer as NULL pointer warnings
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Paul Jackson <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
hharrison authored and torvalds committed Apr 29, 2008
1 parent d613c3e commit b331d25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,8 @@ static ssize_t cpuset_common_file_write(struct cgroup *cont,
return -E2BIG;

/* +1 for nul-terminator */
if ((buffer = kmalloc(nbytes + 1, GFP_KERNEL)) == 0)
buffer = kmalloc(nbytes + 1, GFP_KERNEL);
if (!buffer)
return -ENOMEM;

if (copy_from_user(buffer, userbuf, nbytes)) {
Expand Down
2 changes: 1 addition & 1 deletion kernel/pid_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static struct pid_namespace *create_pid_namespace(int level)
atomic_set(&ns->pidmap[0].nr_free, BITS_PER_PAGE - 1);

for (i = 1; i < PIDMAP_ENTRIES; i++) {
ns->pidmap[i].page = 0;
ns->pidmap[i].page = NULL;
atomic_set(&ns->pidmap[i].nr_free, BITS_PER_PAGE);
}

Expand Down

0 comments on commit b331d25

Please sign in to comment.