[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120522145233.GA17419@elgon.mountain>
Date: Tue, 22 May 2012 17:52:34 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [patch] sched/numa: checking for NULL instead of IS_ERR()
If mpol_new() is called with MPOL_BIND then it can't return a NULL
pointer. We should be checking IS_ERR() here.
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
diff --git a/kernel/sched/numa.c b/kernel/sched/numa.c
index 1149993..36d27ac 100644
--- a/kernel/sched/numa.c
+++ b/kernel/sched/numa.c
@@ -1481,9 +1481,9 @@ SYSCALL_DEFINE4(numa_mbind, unsigned long, addr, unsigned long, len,
mask = nodemask_of_node(ng->numa_entity.node);
mpol = mpol_new(MPOL_BIND, 0, &mask);
- if (!mpol) {
+ if (IS_ERR(mpol)) {
ng_put(ng);
- return -ENOMEM;
+ return PTR_ERR(mpol);
}
mpol->flags |= MPOL_MF_LAZY;
mpol->numa_group = ng;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists