Skip to content
Snippets Groups Projects
Commit c414a739 authored by wadesong's avatar wadesong
Browse files

lrdp-v2: Fix a use-before-init of mem_section

With the latest page tracking script, mem_section will not be
initialized to a valid value in function parse(), unless Linux
kernel version is greater than 3.19. This makes the script
reporting an error when page owner info is parsed for msm-3.18,
and thus page tracking info not saved successfully.

Assign the default value to mem_section unconditionally before
kernel version is checked.

Change-Id: I60961ab204e0e4f4aac7213de3a80a5ed091e4a6
parent 5e9481d2
No related branches found
No related tags found
No related merge requests found
# Copyright (c) 2012,2014-2015,2017-2018 The Linux Foundation. All rights reserved.
# Copyright (c) 2012,2014-2015,2017-2019 The Linux Foundation. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 and
......@@ -206,6 +206,7 @@ class PageTracking(RamParser):
print_out_str('CONFIG_PAGE_OWNER_ENABLE_DEFAULT not defined')
return
mem_section = None
if (self.ramdump.kernel_version >= (3, 19, 0)):
if self.ramdump.is_config_defined('CONFIG_SPARSEMEM'):
mem_section = self.ramdump.read_word('mem_section')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment