state: Fix "pack" returning freed data for DTB backend
This ports the following barebox commit:
| commit ec01cbc
| Author: Ian Abbott <abbotti@mev.co.uk>
| Date: Fri Apr 21 10:53:25 2017 +0100
|
| state: Fix "pack" returning freed data for DTB backend
|
| `state_backend_format_dtb_pack()` passes a buffer containing state
| packed in flattened DTB format back to its caller via its `buf`
| parameter. It then frees the buffer before returning. This means the
| caller (`state_save()`) will be working on freed buffer contents before
| freeing the buffer a second time itself. Fix it by removing the
| spurious call to `free()`.
|
| This should fix a bug reported by Norbert Wiedmann in
| <http://lists.infradead.org/pipermail/barebox/2017-April/029980.html>.
|
| Cc: Norbert Wiedmann <info@n-wiedmann.de>
| Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
| Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Roland Hieber <rhi@pengutronix.de>