From 70984a345a983cea922f2fdc4ad666b2fe71104e Mon Sep 17 00:00:00 2001
From: Patrick Daly <pdaly@codeaurora.org>
Date: Mon, 8 Jan 2018 16:27:09 -0800
Subject: [PATCH] lrdp: Add additional error checking for --autodump

Verify that files exist before checking file size.

Change-Id: Icb55984bf33a677594726345f4c82c55c2948134
---
 linux-ramdump-parser-v2/ramdump.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/linux-ramdump-parser-v2/ramdump.py b/linux-ramdump-parser-v2/ramdump.py
index 9fbabf7..52c6621 100644
--- a/linux-ramdump-parser-v2/ramdump.py
+++ b/linux-ramdump-parser-v2/ramdump.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
+# Copyright (c) 2012-2018, 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
@@ -70,6 +70,8 @@ class AutoDumpInfo(object):
     def parse(self):
         for (filename, base_addr) in self._parse():
             fullpath = os.path.join(self.autodumpdir, filename)
+            if not os.path.exists(fullpath):
+                continue
             end = base_addr + os.path.getsize(fullpath) - 1
             self.ebi_files.append((open(fullpath, 'rb'), base_addr, end, fullpath))
             # sort by addr, DDR files first. The goal is for
-- 
GitLab