UPSTREAM: ich_descriptors: Fix debug print

Allow nm, the number of flash masters, to be equal to
ARRAY_SIZE(master_names). The previous logic was probably overlooked
when ich_number_of_masters() was introduced. The loop below makes sure
that it doesn't access the master_names array out of bounds.

(cherry picked from commit 0b8dcba50cfc425d40500fa55439f679b5f10844)

Original-Change-Id: Ib9276a6c29952487db6e60fb583942c0f24cd6ef
Original-Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/78300
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
GitOrigin-RevId: 0b8dcba50cfc425d40500fa55439f679b5f10844
Change-Id: I2e91e3b0cc8a9806e4e0f820d3be56d35036e00f
Signed-off-by: chromeos-ci-prod <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/4976096
Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org>
Commit-Queue: Hsuan Ting Chen <roccochen@chromium.org>
1 file changed
tree: 19a5cf9e0ed630033445347c1d24899b909957d4
  1. .github/
  2. bindings/
  3. doc/
  4. Documentation/
  5. include/
  6. Makefile.d/
  7. meson_cross/
  8. platform/
  9. scripts/
  10. subprojects/
  11. tests/
  12. util/
  13. .gitattributes
  14. .gitignore
  15. 82802ab.c
  16. action_descriptor.c
  17. action_descriptor.h
  18. amd_imc.c
  19. asm106x.c
  20. at45db.c
  21. atahpt.c
  22. atapromise.c
  23. atavia.c
  24. big_lock.c
  25. big_lock.h
  26. bitbang_spi.c
  27. board_enable.c
  28. buspirate_spi.c
  29. cbtable.c
  30. ch341a_spi.c
  31. ch347_spi.c
  32. chipset_enable.c
  33. cli_classic.c
  34. cli_common.c
  35. cli_getopt.c
  36. cli_output.c
  37. COPYING
  38. cros_alias.c
  39. cros_ec.c
  40. cros_ec_commands.h
  41. custom_baud.c
  42. custom_baud_darwin.c
  43. custom_baud_linux.c
  44. dediprog.c
  45. developerbox_spi.c
  46. digilent_spi.c
  47. DIR_METADATA
  48. dirtyjtag_spi.c
  49. dmi.c
  50. Doxyfile
  51. drkaiser.c
  52. dummyflasher.c
  53. edi.c
  54. en29lv640b.c
  55. erasure_layout.c
  56. file_lock.c
  57. flashchips.c
  58. flashchips_crosbl.c
  59. flashrom.c
  60. fmap.c
  61. ft2232_spi.c
  62. gfxnvidia.c
  63. helpers.c
  64. helpers_fileio.c
  65. hwaccess_physmap.c
  66. hwaccess_x86_io.c
  67. hwaccess_x86_msr.c
  68. i2c_helper_linux.c
  69. ich_descriptors.c
  70. ichspi.c
  71. internal.c
  72. internal_par.c
  73. ipc_lock.h
  74. it8212.c
  75. it87spi.c
  76. jedec.c
  77. jlink_spi.c
  78. known_boards.c
  79. layout.c
  80. libflashrom.c
  81. libflashrom.map
  82. linux_mtd.c
  83. linux_spi.c
  84. MAINTAINERS
  85. Makefile
  86. Makefile.include
  87. mcp6x_spi.c
  88. mediatek_i2c_spi.c
  89. meson.build
  90. meson_options.txt
  91. mstarddc_spi.c
  92. ni845x_spi.c
  93. nic3com.c
  94. nicintel.c
  95. nicintel_eeprom.c
  96. nicintel_spi.c
  97. nicnatsemi.c
  98. nicrealtek.c
  99. ogp_spi.c
  100. opaque.c
  101. OWNERS
  102. parade_lspcon.c
  103. parallel.c
  104. pcidev.c
  105. pickit2_spi.c
  106. pony_spi.c
  107. power.c
  108. power.h
  109. PRESUBMIT.cfg
  110. print.c
  111. print_wiki.c
  112. printlock.c
  113. processor_enable.c
  114. programmer.c
  115. programmer_table.c
  116. raiden_debug_spi.c
  117. rayer_spi.c
  118. README.chromiumos
  119. README.rst
  120. realtek_mst_i2c_spi.c
  121. s25f.c
  122. satamv.c
  123. satasii.c
  124. sb600spi.c
  125. serial.c
  126. serprog.c
  127. sfdp.c
  128. spi.c
  129. spi25.c
  130. spi25_statusreg.c
  131. spi95.c
  132. sst28sf040.c
  133. sst49lfxxxc.c
  134. sst_fwhub.c
  135. stlinkv3_spi.c
  136. stm50.c
  137. superio.c
  138. test_build.sh
  139. udelay.c
  140. unblocked_terms.txt
  141. usb_device.c
  142. usbblaster_spi.c
  143. usbdev.c
  144. VERSION
  145. w29ee011.c
  146. w39.c
  147. wbsio_spi.c
  148. writeprotect.c
  149. writeprotect_ranges.c