Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b331d259 authored by Harvey Harrison's avatar Harvey Harrison Committed by Linus Torvalds
Browse files

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: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Reviewed-by: default avatarPaul Jackson <pj@sgi.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d613c3e2
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1265,7 +1265,8 @@ static ssize_t cpuset_common_file_write(struct cgroup *cont,
		return -E2BIG;
		return -E2BIG;


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


	if (copy_from_user(buffer, userbuf, nbytes)) {
	if (copy_from_user(buffer, userbuf, nbytes)) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -92,7 +92,7 @@ static struct pid_namespace *create_pid_namespace(int level)
	atomic_set(&ns->pidmap[0].nr_free, BITS_PER_PAGE - 1);
	atomic_set(&ns->pidmap[0].nr_free, BITS_PER_PAGE - 1);


	for (i = 1; i < PIDMAP_ENTRIES; i++) {
	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);
		atomic_set(&ns->pidmap[i].nr_free, BITS_PER_PAGE);
	}
	}