external/pflash: Remove use of exit() and fix memory leaks
external/pflash: Remove use of exit() and fix memory leaks

Using exit() all over the place has lead to a huge mess of leaving all
sorts of dangling references to malloc()ed memory, to blocklevel_devices
and even sometimes file descriptors.

Stop using exit() and simply report everything back to the main where
everything can be freed on the way back out.

Signed-off-by: Cyril Bur <6ce38dade8c4b52fd55c193fae70fd1d1275c3c3@au1.ibm.com>
Reviewed-by: Samuel Mendoza-Jonas <f16bed56189e249fe4ca8ed10a1ecae60e8ceac0@mendozajonas.com>
Signed-off-by: Stewart Smith <ec31ab75ddf977353c8f660f92ea8b23f64aef25@linux.vnet.ibm.com>

qemu/skiboot,shenki/skiboot,legoater/skiboot,mikey/skiboot,qemu/skiboot,open-power/skiboot,shenki/skiboot,shenki/skiboot,qemu/skiboot,stewart-ibm/skiboot,open-power/skiboot,legoater/skiboot,open-power/skiboot,stewart-ibm/skiboot,open-power/skiboot,qemu/skiboot,legoater/skiboot,shenki/skiboot,mikey/skiboot,legoater/skiboot,qemu/skiboot,shenki/skiboot,stewart-ibm/skiboot,mikey/skiboot,open-power/skiboot,legoater/skiboot