drivers/base/memory.c: fix kw reported issue
Fix KW reported 'NULL pointer dereference' issue. This is fixed in the upstream as part of 848e19ad3c335 ("drivers/base/memory.c: drop the mem_sysfs_mutex") but the reason not to pick this up as it is that it contains the additional changes not so important for 4.19 kernels. Change-Id: I7cb5b5202c29b280c853b849f29201d70520faf5 Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
This commit is contained in:
parent
49f043455b
commit
4a54f26716
@ -845,6 +845,8 @@ int create_memory_block_devices(unsigned long start, unsigned long size)
|
||||
for (block_id = start_block_id; block_id != end_block_id;
|
||||
block_id++) {
|
||||
mem = find_memory_block_by_id(block_id, NULL);
|
||||
if (WARN_ON_ONCE(!mem))
|
||||
continue;
|
||||
mem->section_count = 0;
|
||||
unregister_memory(mem);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user