@@ -706,12 +706,12 @@ is_region_locked() {
706706# 0 if found, 1 otherwise.
707707flashrom_check_for_region () {
708708 local region=" $1 "
709- local -n _args= " $2 "
710- local i
709+ shift
710+ local -a args=( " $@ " )
711711
712712 # Iterate only up to length-1 since we inspect pairs (i, i+1)
713- for (( i = 0 ; i < ${# _args [@]} - 1 ; i++ )) ; do
714- if [[ " ${_args [i]} " == " -i" && " ${_args [i + 1]} " == " $region " ]]; then
713+ for (( i = 0 ; i < ${# args [@]} - 1 ; i++ )) ; do
714+ if [[ " ${args [i]} " == " -i" && " ${args [i + 1]} " == " $region " ]]; then
715715 return 0
716716 fi
717717 done
@@ -722,20 +722,20 @@ flashrom_check_for_region() {
722722# Does a final check for all flashrom parameters if FD or ME are to be flashed
723723# and if they're locked. Decide whether we can proceed if any regions are locked.
724724flashrom_region_check () {
725- local -n args=" $1 "
725+ local -a args=( " $@ " )
726726 local locked_regions=()
727727 local region_list verb
728728
729729 # If switching to heads, always check the region, otherwise check region only
730730 # if specified in params.
731731 # The reason is we want to handle both "overwrites" form metadata as well as
732732 # dynamically added params from set_intel_regions_update_params()
733- if (flashrom_check_for_region fd args || [[ " $SWITCHING_TO " == " heads" ]]) &&
733+ if (flashrom_check_for_region fd " ${ args[@]} " || [[ " $SWITCHING_TO " == " heads" ]]) &&
734734 is_region_locked fd; then
735735 locked_regions+=(" FD" )
736736 fi
737737
738- if (flashrom_check_for_region me args || [[ " $SWITCHING_TO " == " heads" ]]) &&
738+ if (flashrom_check_for_region me " ${ args[@]} " || [[ " $SWITCHING_TO " == " heads" ]]) &&
739739 is_region_locked me; then
740740 locked_regions+=(" ME" )
741741 fi
0 commit comments