Skip to content
Commit 37171e3c authored by Seth Jennings's avatar Seth Jennings Committed by Greg Kroah-Hartman
Browse files

drivers: base: remove improper get/put in add_memory_section()



The path through add_memory_section() when the memory block already
exists uses flawed refcounting logic.  A get_device() is done on a
memory block using a pointer that might not be valid as we dropped
our previous reference and didn't obtain a new reference in the
proper way.

Lets stop pretending and just remove the get/put.  The
mem_sysfs_mutex, which we hold over the entire init loop now, will
prevent the memory blocks from disappearing from under us.

Signed-off-by: default avatarSeth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 37a7bd62
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment