Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338728
b: refs/heads/master
c: fa7194e
h: refs/heads/master
v: v3
  • Loading branch information
Yasuaki Ishimatsu authored and Linus Torvalds committed Dec 12, 2012
1 parent 7fae89b commit 812abe1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b3092b3b734f146d96ca023a75cacf78078f96d5
refs/heads/master: fa7194eb99b8e9fefe96f045002648ffb55f53c0
9 changes: 8 additions & 1 deletion trunk/drivers/base/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ void unregister_memory_isolate_notifier(struct notifier_block *nb)
}
EXPORT_SYMBOL(unregister_memory_isolate_notifier);

static void memory_block_release(struct device *dev)
{
struct memory_block *mem = container_of(dev, struct memory_block, dev);

kfree(mem);
}

/*
* register_memory - Setup a sysfs device for a memory block
*/
Expand All @@ -80,6 +87,7 @@ int register_memory(struct memory_block *memory)

memory->dev.bus = &memory_subsys;
memory->dev.id = memory->start_section_nr / sections_per_block;
memory->dev.release = memory_block_release;

error = device_register(&memory->dev);
return error;
Expand Down Expand Up @@ -635,7 +643,6 @@ int remove_memory_block(unsigned long node_id, struct mem_section *section,
mem_remove_simple_file(mem, phys_device);
mem_remove_simple_file(mem, removable);
unregister_memory(mem);
kfree(mem);
} else
kobject_put(&mem->dev.kobj);

Expand Down

0 comments on commit 812abe1

Please sign in to comment.