Commit 37171e3
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: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 37a7bd6 commit 37171e3
1 file changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
613 | 613 | | |
614 | 614 | | |
615 | 615 | | |
616 | | - | |
617 | 616 | | |
618 | 617 | | |
619 | 618 | | |
620 | | - | |
| 619 | + | |
621 | 620 | | |
622 | | - | |
623 | | - | |
| 621 | + | |
624 | 622 | | |
625 | 623 | | |
626 | 624 | | |
| |||
0 commit comments