acpi: check for pxm_to_node_map overflow
authorCyrill Gorcunov <[email protected]>
Wed, 4 Mar 2009 19:55:29 +0000 (11:55 -0800)
committerLen Brown <[email protected]>
Mon, 16 Mar 2009 04:35:30 +0000 (00:35 -0400)
It is hardly (if ever) possible but in case of broken _PXM entry we could
reach out of pxm_to_node_map array bounds in acpi_map_pxm_to_node() call.

Signed-off-by: Cyrill Gorcunov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Len Brown <[email protected]>
drivers/acpi/numa.c

index c5e292aab0e34c77f94d1089942ebba06ffcd3d8..3a0d8ef25c75c453175377236f9f56e731d53182 100644 (file)
@@ -277,7 +277,7 @@ int acpi_get_node(acpi_handle *handle)
        int pxm, node = -1;
 
        pxm = acpi_get_pxm(handle);
-       if (pxm >= 0)
+       if (pxm >= 0 && pxm < MAX_PXM_DOMAINS)
                node = acpi_map_pxm_to_node(pxm);
 
        return node;