summaryrefslogtreecommitdiffstats
path: root/lib/zlib_inflate
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-03-29 13:07:09 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-04-08 13:33:18 +0200
commit3bafe5eac5b48193607c4617f32d9e5e2075189f (patch)
treea9a524dae075f47b4b5b9ac8896fec4fe34410a1 /lib/zlib_inflate
parent68bd0e50360fd97914e0716f4c9d81ceb980e3ba (diff)
downloadbarebox-3bafe5eac5b48193607c4617f32d9e5e2075189f.tar.gz
barebox-3bafe5eac5b48193607c4617f32d9e5e2075189f.tar.xz
decompressors: Use malloc/free wrappers
The decompressors are used both in a regular image and also for image decompression. Both need different malloc implementations. Using malloc/free directly in the decompressor code easily leads to include file conflicts, so use MALLOC/FREE which can be defined correctly for the two different usecases. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib/zlib_inflate')
-rw-r--r--lib/zlib_inflate/infutil.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/zlib_inflate/infutil.c b/lib/zlib_inflate/infutil.c
index f452ba6040..d9765523a9 100644
--- a/lib/zlib_inflate/infutil.c
+++ b/lib/zlib_inflate/infutil.c
@@ -12,10 +12,10 @@ int zlib_inflate_blob(void *gunzip_buf, unsigned int sz,
int rc;
rc = -ENOMEM;
- strm = kmalloc(sizeof(*strm), GFP_KERNEL);
+ strm = MALLOC(sizeof(*strm));
if (strm == NULL)
goto gunzip_nomem1;
- strm->workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
+ strm->workspace = MALLOC(zlib_inflate_workspacesize());
if (strm->workspace == NULL)
goto gunzip_nomem2;
@@ -39,9 +39,9 @@ int zlib_inflate_blob(void *gunzip_buf, unsigned int sz,
} else
rc = -EINVAL;
- kfree(strm->workspace);
+ FREE(strm->workspace);
gunzip_nomem2:
- kfree(strm);
+ FREE(strm);
gunzip_nomem1:
return rc; /* returns Z_OK (0) if successful */
}