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

Commit 37afa96b authored by Manoj Prabhu B's avatar Manoj Prabhu B Committed by Gerrit - the friendly Code Review server
Browse files

memshare: Skip collecting elf for failed hypervisor unmapping memory



Prevent collecting ramdump for memory region which have failed to
hypervisor unmap by continuing through the loop and with proper
checks for successful hypervisor mapping.

Change-Id: Ied3e5c840cbf66170cfbcf09eecd6130dd34bd6c
Signed-off-by: default avatarManoj Prabhu B <bmanoj@codeaurora.org>
parent f7be1951
Loading
Loading
Loading
Loading
+21 −18
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/err.h>
@@ -260,11 +260,13 @@ static int mem_share_do_ramdump(void)
				dev_err(memsh_child->dev,
					"memshare: %s: failed to map the memory region to APPS\n",
					client_name);
				continue;
			} else {
				memblock[i].hyp_mapping = 0;
			}
		}

		if (!memblock[i].hyp_mapping) {
			ramdump_segments_tmp = kcalloc(1,
				sizeof(struct ramdump_segment),
				GFP_KERNEL);
@@ -287,6 +289,7 @@ static int mem_share_do_ramdump(void)
				return ret;
			}
		}
	}
	return 0;
}