UPSTREAM: erasure_layout: Fix unaligned region end offset by 1

In the case when layout region is not aligned with eraseblock,
end region boundary is extended to match the eraseblock. There is
a special handling of this extended area (between original end of
region and extended one). Fix the offset of this extended area by +1
so that it covers the extended area and not the original region.

Before the patch, the last byte of the original region was failed to
write since it was treated as if an extended area, while it was the
last byte of the normal layout region.

(cherry picked from commit 48b9ece5ad011573eddadc09d6854fc1b82c5cd0)

Original-Ticket: https://ticket.coreboot.org/issues/494
Original-Change-Id: I7f78a0090065cd2a952cba1a5d28179483ba4c55
Original-Signed-off-by: Anastasia Klimchuk <aklm@flashrom.org>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/78984
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Peter Marheine <pmarheine@chromium.org>
GitOrigin-RevId: 48b9ece5ad011573eddadc09d6854fc1b82c5cd0
Change-Id: Iec04acc4aa479d7d8ab2cc34fb081533c0f370d3
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/+/5198246
Commit-Queue: Hsuan Ting Chen <roccochen@chromium.org>
Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org>
1 file changed
tree: 3a8659ff00ae6b031f768621cb91214b2a3f67a6
  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_ec.c
  39. cros_ec_commands.h
  40. custom_baud.c
  41. custom_baud_darwin.c
  42. custom_baud_linux.c
  43. dediprog.c
  44. developerbox_spi.c
  45. digilent_spi.c
  46. DIR_METADATA
  47. dirtyjtag_spi.c
  48. dmi.c
  49. Doxyfile
  50. drkaiser.c
  51. dummyflasher.c
  52. edi.c
  53. en29lv640b.c
  54. erasure_layout.c
  55. file_lock.c
  56. flashchips.c
  57. flashchips_crosbl.c
  58. flashrom.c
  59. fmap.c
  60. ft2232_spi.c
  61. gfxnvidia.c
  62. helpers.c
  63. helpers_fileio.c
  64. hwaccess_physmap.c
  65. hwaccess_x86_io.c
  66. hwaccess_x86_msr.c
  67. i2c_helper_linux.c
  68. ich_descriptors.c
  69. ichspi.c
  70. internal.c
  71. internal_par.c
  72. ipc_lock.h
  73. it8212.c
  74. it87spi.c
  75. jedec.c
  76. jlink_spi.c
  77. known_boards.c
  78. layout.c
  79. libflashrom.c
  80. libflashrom.map
  81. linux_mtd.c
  82. linux_spi.c
  83. MAINTAINERS
  84. Makefile
  85. Makefile.include
  86. mcp6x_spi.c
  87. mediatek_i2c_spi.c
  88. meson.build
  89. meson_options.txt
  90. mstarddc_spi.c
  91. ni845x_spi.c
  92. nic3com.c
  93. nicintel.c
  94. nicintel_eeprom.c
  95. nicintel_spi.c
  96. nicnatsemi.c
  97. nicrealtek.c
  98. ogp_spi.c
  99. opaque.c
  100. OWNERS
  101. parade_lspcon.c
  102. parallel.c
  103. pcidev.c
  104. pickit2_spi.c
  105. pony_spi.c
  106. power.c
  107. power.h
  108. PRESUBMIT.cfg
  109. print.c
  110. print_wiki.c
  111. printlock.c
  112. processor_enable.c
  113. programmer.c
  114. programmer_table.c
  115. raiden_debug_spi.c
  116. rayer_spi.c
  117. README.chromiumos
  118. README.rst
  119. realtek_mst_i2c_spi.c
  120. s25f.c
  121. satamv.c
  122. satasii.c
  123. sb600spi.c
  124. serial.c
  125. serprog.c
  126. sfdp.c
  127. spi.c
  128. spi25.c
  129. spi25_statusreg.c
  130. spi95.c
  131. sst28sf040.c
  132. sst49lfxxxc.c
  133. sst_fwhub.c
  134. stlinkv3_spi.c
  135. stm50.c
  136. superio.c
  137. test_build.sh
  138. udelay.c
  139. unblocked_terms.txt
  140. usb_device.c
  141. usbblaster_spi.c
  142. usbdev.c
  143. VERSION
  144. w29ee011.c
  145. w39.c
  146. wbsio_spi.c
  147. writeprotect.c
  148. writeprotect_ranges.c