]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - mm/memcontrol.c
IB/hfi1: Fix NULL pointer dereference when invalid num_vls is used
[linux.git] / mm / memcontrol.c
index f314334546a2339483a92be62f58224af2234fcf..e074f7c637aa4e62d6268d3e765564e6f2a9cde0 100644 (file)
@@ -4108,6 +4108,9 @@ static void free_mem_cgroup_per_node_info(struct mem_cgroup *memcg, int node)
 {
        struct mem_cgroup_per_node *pn = memcg->nodeinfo[node];
 
+       if (!pn)
+               return;
+
        free_percpu(pn->lruvec_stat_cpu);
        kfree(pn);
 }
@@ -5971,9 +5974,9 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry)
 
        /*
         * Interrupts should be disabled here because the caller holds the
-        * mapping->tree_lock lock which is taken with interrupts-off. It is
+        * i_pages lock which is taken with interrupts-off. It is
         * important here to have the interrupts disabled because it is the
-        * only synchronisation we have for udpating the per-CPU variables.
+        * only synchronisation we have for updating the per-CPU variables.
         */
        VM_BUG_ON(!irqs_disabled());
        mem_cgroup_charge_statistics(memcg, page, PageTransHuge(page),