Skip to contentSkip to conversation

Fix /proc/slab_allocators re seq_list_next() conversion

PATCH In review Alexey Dobriyan 2 participants 2 messages Jun 4, 2007 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix /proc/slab_allocators re seq_list_next() conversion

Wrong pointer was used as kmem_cache pointer.

[Here /proc/slab_allocators appears as empty file, but it's just me, probably]

---

 mm/slab.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/slab.c +1 -1
@@ -4401,7 +4401,7 @@ static void show_symbol(struct seq_file *m, unsigned long address)
 
 static int leaks_show(struct seq_file *m, void *p)
 {
-	struct kmem_cache *cachep = p;
+	struct kmem_cache *cachep = list_entry(p, struct kmem_cache, next);
 	struct slab *slabp;
 	struct kmem_list3 *l3;
 	const char *name;
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Alexey Dobriyan

Wrong pointer was used as kmem_cache pointer.

[Here /proc/slab_allocators appears as empty file, but it's just me, probably]

Quoted 18 lines

---

 mm/slab.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/slab.c +1 -1
@@ -4401,7 +4401,7 @@ static void show_symbol(struct seq_file *m, unsigned long address)
 
 static int leaks_show(struct seq_file *m, void *p)
 {
-	struct kmem_cache *cachep = p;
+	struct kmem_cache *cachep = list_entry(p, struct kmem_cache, next);
 	struct slab *slabp;
 	struct kmem_list3 *l3;
 	const char *name;