Skip to content

Commit

Permalink
Fix logic error in save_efi_tree_filetype function
Browse files Browse the repository at this point in the history
Signed-off-by: brentholtsclaw <brent.holtsclaw@intel.com>
  • Loading branch information
BrentHoltsclaw committed Jul 11, 2024
1 parent 04c3d1d commit 35364e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chipsec/hal/spi_uefi.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,15 +577,15 @@ def save_efi_tree_filetype(modules: List['EFI_MODULE'],
path: str = '',
lvl: int = 0,
filetype: List[int] = [],
save: bool = False
save: bool = True
) -> List[Dict[str, Any]]:
mod_dir_path = path
modules_arr = []
modn = 0
for m in modules:
md: Dict[str, Any] = {}
m.indent = DEF_INDENT * lvl
if (isinstance(m, EFI_FILE) and m.Type in filetype) or save:
if (isinstance(m, EFI_FILE) and m.Type in filetype) and save:
logger().log(str(m))

# extract all non-function non-None members of EFI_MODULE objects
Expand All @@ -610,7 +610,7 @@ def save_efi_tree_filetype(modules: List['EFI_MODULE'],
os.makedirs(mod_dir_path)
# save children modules
if len(m.children) > 0:
md["children"] = save_efi_tree_filetype(m.children, m, mod_dir_path, lvl + 1, filetype)
md["children"] = save_efi_tree_filetype(m.children, m, mod_dir_path, lvl + 1, filetype, save)
else:
del md["children"]

Expand Down

0 comments on commit 35364e1

Please sign in to comment.