bmaptool: fix flashing without bmap
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Tue, 8 Jan 2013 15:00:03 +0000 (17:00 +0200)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Tue, 8 Jan 2013 15:00:03 +0000 (17:00 +0200)
The auto-discovery function was buggy and returned a junk bmap file name if no
bmap files was found.

Change-Id: I2ab3db14dcccd72e687e6afb8e3cfcaa9c827452
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
bmaptool

index 2d65497..25b0fca 100755 (executable)
--- a/bmaptool
+++ b/bmaptool
@@ -81,7 +81,7 @@ def find_and_open_bmap(image_path):
         try:
             bmap_obj = TransRead.TransRead(bmap_path)
             bmap_obj.close()
-            break
+            return bmap_path
         except TransRead.Error as err:
             pass
 
@@ -89,7 +89,7 @@ def find_and_open_bmap(image_path):
         if ext == '':
             break
 
-    return bmap_path
+    return None
 
 def copy_command_open_all(args, log):
     """ Open the image/bmap/destination files for the "copy" command. Returns a