Re: [PATCH] mm: numa: fix NULL pointer dereference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2013/8/6 Mauro Dreissig <mukadr@xxxxxxxxx>
From: Mauro Dreissig <mukadr@xxxxxxxxx>

The "pol->mode" field is accessed even when no mempolicy
is assigned to the "pol" variable.

Signed-off-by: Mauro Dreissig <mukadr@xxxxxxxxx>
---
 mm/mempolicy.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 6b1d426..105fff0 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -127,12 +127,16 @@ static struct mempolicy *get_task_policy(struct task_struct *p)

        if (!pol) {
                node = numa_node_id();
-               if (node != NUMA_NO_NODE)
+               if (node != NUMA_NO_NODE) {
                        pol = &preferred_node_policy[node];

-               /* preferred_node_policy is not initialised early in boot */
-               if (!pol->mode)
-                       pol = NULL;
+                       /*
+                        * preferred_node_policy is not initialised early
+                        * in boot
+                        */
+                       if (!pol->mode)
+                               pol = NULL;
+               }
        }

        return pol;
--
1.8.1.2


A patch about this issue already exist, please ignore my message.

http://marc.info/?l=linux-mm&m=137576205227365&w=2


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]