cros_ec: Fix memory leak in write worker

Scope and simplify loop construct as to not leak packet
heap allocation.

BUG=b:300180551
BRANCH=none
TEST=builds

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