Skip to content

Commit

Permalink
do not crash if pbl return nil (bnc#927237)
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Apr 24, 2015
1 parent b0537f3 commit ca87ec8
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/include/bootloader/routines/lib_iface.rb
Expand Up @@ -105,9 +105,9 @@ def SetDiskInfo

nil
ensure
mp_data.unlink
part_data.unlink
md_data.unlink
mp_data.unlink if mp_data
part_data.unlink if part_data
md_data.unlink if md_data
end

# Initialize the bootloader library
Expand Down Expand Up @@ -161,7 +161,7 @@ def SetSections(sections)

true
ensure
sections_data.unlink
sections_data.unlink if sections_data
end

# Get boot loader sections
Expand All @@ -179,7 +179,7 @@ def GetSections

sects
ensure
sections_data.unlink
sections_data.unlink if sections_data
end

# Set global bootloader options
Expand All @@ -195,7 +195,7 @@ def SetGlobal(globals)

true
ensure
globals_data.unlink
globals_data.unlink if globals_data
end

# Get global bootloader options
Expand All @@ -214,7 +214,7 @@ def GetGlobal
Builtins.y2milestone("Read global settings: %1", glob)
glob
ensure
globals_data.unlink
globals_data.unlink if globals_data
end

# Set the device mapping (Linux <-> Firmware)
Expand All @@ -228,7 +228,7 @@ def SetDeviceMap(device_map)

true
ensure
arg_data.unlink
arg_data.unlink if arg_data
end

# Set the mapping (real device <-> multipath)
Expand Down Expand Up @@ -269,7 +269,7 @@ def GetDeviceMap
Builtins.y2milestone("Read device mapping: %1", devmap)
devmap
ensure
res_data.unlink
res_data.unlink if res_data
end

# Read the files from the system to internal cache of the library
Expand All @@ -284,7 +284,7 @@ def ReadFiles(avoid_reading_device_map)

true
ensure
param_data.unlink
param_data.unlink if param_data
end

# Flush the internal cache of the library to the disk
Expand All @@ -305,7 +305,7 @@ def UpdateBootloader
Builtins.y2milestone("Updating bootloader configuration")
run_pbl_yaml "UpdateBootloader(#{arg_data.path})"
ensure
arg_data.unlink
arg_data.unlink if arg_data
end

def SetSecureBoot(enable)
Expand All @@ -316,7 +316,7 @@ def SetSecureBoot(enable)

true
ensure
arg_data.unlink
arg_data.unlink if arg_data
end


Expand All @@ -339,8 +339,8 @@ def UpdateSerialConsole(append, console)

append_data.data
ensure
args_data.unlink
append_data.unlink
args_data.unlink if args_data
append_data.unlink if append_data
end

# Initialize the boot loader (eg. modify firmware, depending on architecture)
Expand Down Expand Up @@ -372,7 +372,7 @@ def GetFilesContents

ret
ensure
ret_data.unlink
ret_data.unlink if ret_data
end

# Set the contents of all files to library cache
Expand All @@ -386,7 +386,7 @@ def SetFilesContents(files)

true
ensure
files_data.unlink
files_data.unlink if files_data
end

# Analyse content of MBR
Expand All @@ -404,8 +404,8 @@ def examineMBR(device)
Builtins.y2milestone("Device: %1 includes in MBR: %2", device, ret)
ret
ensure
device_data.unlink
ret_data.unlink
device_data.unlink if device_data
ret_data.unlink if ret_data
end
end
end

0 comments on commit ca87ec8

Please sign in to comment.