Free mmaped area if keys fail to load

Keys for package verification is loaded after the update
package is mmaped into memory. This mmaped area needs
to be freed when exiting the function.

Another approach would be to mmap after loading the keys.

Change-Id: Ib77711a8acd5c363b5517da12dc311fb8f9f4605
Signed-off-by: WiZarD <WiZarD.Devel@gmail.com>
1 file changed
tree: 21ea4accccd6cb53949a5fce1812c7aa574fa43a
  1. applypatch/
  2. edify/
  3. etc/
  4. fonts/
  5. minadbd/
  6. minui/
  7. minzip/
  8. otafault/
  9. res-hdpi/
  10. res-mdpi/
  11. res-xhdpi/
  12. res-xxhdpi/
  13. res-xxxhdpi/
  14. tests/
  15. tools/
  16. uncrypt/
  17. update_verifier/
  18. updater/
  19. adb_install.cpp
  20. adb_install.h
  21. Android.mk
  22. asn1_decoder.cpp
  23. asn1_decoder.h
  24. bootloader.cpp
  25. bootloader.h
  26. CleanSpec.mk
  27. common.h
  28. default_device.cpp
  29. device.cpp
  30. device.h
  31. fuse_sdcard_provider.cpp
  32. fuse_sdcard_provider.h
  33. fuse_sideload.cpp
  34. fuse_sideload.h
  35. install.cpp
  36. install.h
  37. interlace-frames.py
  38. mounts.cpp
  39. mounts.h
  40. NOTICE
  41. print_sha1.h
  42. README.md
  43. recovery-persist.cpp
  44. recovery-persist.rc
  45. recovery-refresh.cpp
  46. recovery-refresh.rc
  47. recovery.cpp
  48. roots.cpp
  49. roots.h
  50. screen_ui.cpp
  51. screen_ui.h
  52. ui.cpp
  53. ui.h
  54. verifier.cpp
  55. verifier.h
  56. wear_ui.cpp
  57. wear_ui.h
README.md

The Recovery Image

Quick turn-around testing

mm -j && m ramdisk-nodeps && m recoveryimage-nodeps

# To boot into the new recovery image
# without flashing the recovery partition:
adb reboot bootloader
fastboot boot $ANDROID_PRODUCT_OUT/recovery.img

Running the tests

# After setting up environment and lunch.
mmma -j bootable/recovery

# Running the tests on device.
adb root
adb sync data

# 32-bit device
adb shell /data/nativetest/recovery_unit_test/recovery_unit_test
adb shell /data/nativetest/recovery_component_test/recovery_component_test

# Or 64-bit device
adb shell /data/nativetest64/recovery_unit_test/recovery_unit_test
adb shell /data/nativetest64/recovery_component_test/recovery_component_test