Skip to contentSkip to conversation

statistics: fix cpu hot unplug related memory leak

PATCH New Martin Peschke 1 participant 1 message Apr 10, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 statistics: fix cpu hot unplug related memory leak

In case of CPU hotunplug statistics might have leaked some memory (lists of struct statistic_entry_sparse, about 32 byte each, freed by statistic_sparse_reset()).

Patch is against 2.6.21-rc6-mm1.

---

 statistic.c |    1 +
 1 file changed, 1 insertion(+)
lib/statistic.c +1 -0
Index: linux/lib/statistic.c
===================================================================
@@ -308,6 +308,7 @@ static int _statistic_hotcpu(struct stat
 		src = percpu_ptr(stat->data, cpu);
 		disc->merge(stat, dst, src);
 		local_irq_restore(flags);
+		disc->reset(stat, src);
 		percpu_depopulate(stat->data, cpu);
 		break;
 	}