Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a54f267 authored by Charan Teja Reddy's avatar Charan Teja Reddy Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarCharan Teja Reddy <charante@codeaurora.org>
parent 49f04345
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);
		}