Skip to content

Commit

Permalink
Correct the CodeQL warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerX87 committed Oct 27, 2022
1 parent 2962ef4 commit fbd64db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions device/wistron/x86_64-wistron_6512_32r-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def get_presence(self, port_num):
val_file.close()
except IOError as e:
print("Error: unable to access file: %s" % str(e))
val_file.close()
return False

if content == "1":
Expand All @@ -134,6 +135,7 @@ def get_low_power_mode(self, port_num):
val_file.close()
except IOError as e:
print("Error: unable to access file: %s" % str(e))
val_file.close()
return False

if content == "1":
Expand All @@ -158,6 +160,7 @@ def set_low_power_mode(self, port_num, lpmode):
return True
except IOError as e:
print("Error: unable to open file: %s" % str(e))
val_file.close()
return False

def reset(self, port_num):
Expand All @@ -183,6 +186,7 @@ def reset(self, port_num):
return True
except IOError as e:
print("Error: unable to open file: %s" % str(e))
val_file.close()
return False


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,7 @@ def set_lpmode(self, lpmode):
val_file.close()
return True
except IOError:
val_file.close()
return False

def set_power_override(self, power_override, power_set):
Expand Down

0 comments on commit fbd64db

Please sign in to comment.