summaryrefslogtreecommitdiff
path: root/lib/x1000-installer/src
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-10-15 09:08:09 -0400
committerWilliam Wilgus <me.theuser@yahoo.com>2022-10-15 09:26:58 -0400
commit12ef045fdf5a9e2b4d5618cc3b7ba50ecc0ccf69 (patch)
treeb4885951a5cba1b78c21b30ce37a1d6f1574aa5f /lib/x1000-installer/src
parent9d3d925295112a0080bc1d70fad170db9e1af2a9 (diff)
downloadrockbox-12ef045fdf5a9e2b4d5618cc3b7ba50ecc0ccf69.tar.gz
rockbox-12ef045fdf5a9e2b4d5618cc3b7ba50ecc0ccf69.zip
move buflib_free invalid handle check to the function
allow buflib_free to check for invalid or already freed handles within the function -- remove all the invalid handle guards thru core_free Change-Id: Ibdcbc82760fc93b674c42283fca420d94907df8e
Diffstat (limited to 'lib/x1000-installer/src')
-rw-r--r--lib/x1000-installer/src/xf_nandio.c5
-rw-r--r--lib/x1000-installer/src/xf_package.c5
2 files changed, 2 insertions, 8 deletions
diff --git a/lib/x1000-installer/src/xf_nandio.c b/lib/x1000-installer/src/xf_nandio.c
index 29ff9d9120..6dc87bc420 100644
--- a/lib/x1000-installer/src/xf_nandio.c
+++ b/lib/x1000-installer/src/xf_nandio.c
@@ -75,10 +75,7 @@ int xf_nandio_init(struct xf_nandio* nio)
75 75
76void xf_nandio_destroy(struct xf_nandio* nio) 76void xf_nandio_destroy(struct xf_nandio* nio)
77{ 77{
78 if(nio->alloc_handle > 0) { 78 nio->alloc_handle = core_free(nio->alloc_handle);
79 core_free(nio->alloc_handle);
80 nio->alloc_handle = 0;
81 }
82 79
83 if(nio->ndrv) { 80 if(nio->ndrv) {
84 nand_lock(nio->ndrv); 81 nand_lock(nio->ndrv);
diff --git a/lib/x1000-installer/src/xf_package.c b/lib/x1000-installer/src/xf_package.c
index 04b32cdcb0..fb107aef72 100644
--- a/lib/x1000-installer/src/xf_package.c
+++ b/lib/x1000-installer/src/xf_package.c
@@ -257,8 +257,5 @@ void xf_package_close(struct xf_package* pkg)
257 if(mtar_is_open(pkg->tar)) 257 if(mtar_is_open(pkg->tar))
258 mtar_close(pkg->tar); 258 mtar_close(pkg->tar);
259 259
260 if(pkg->alloc_handle > 0) { 260 pkg->alloc_handle = core_free(pkg->alloc_handle);
261 core_free(pkg->alloc_handle);
262 pkg->alloc_handle = 0;
263 }
264} 261}