Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\zlib_inflate\infutil.c Create Date:2022-07-28 06:58:05
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Utility function: initialize zlib, unpack binary blob, clean up zlib,* return len or negative error code.

Proto:int zlib_inflate_blob(void *gunzip_buf, unsigned int sz, const void *buf, unsigned int len)

Type:int

Parameter:

TypeParameterName
void *gunzip_buf
unsigned intsz
const void *buf
unsigned intlen
12  zbuf = buf
16  rc = -ENOMEM
17  strm = kmalloc( size of strm , GFP_KERNEL)
18  If (strm == NULL) Then Go to gunzip_nomem1
20  memory allocated for this stream = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL)
21  If ( memory allocated for this stream == NULL) Then Go to gunzip_nomem2
27  next input byte = zbuf
28  number of bytes available at next_in = len
29  next output byte should be put there = gunzip_buf
30  remaining free space at next_out = sz
32  rc = zlib_inflateInit2(strm, - 32K LZ77 window )
33  If rc == Allowed flush values; see deflate() and inflate() below for details Then
34  rc = late() uses a state machine to process as much input data and generate asmuch output data as possible before returning
36  If rc == Z_STREAM_END Then rc = sz - remaining free space at next_out
38  Else rc = -EINVAL
40  zlib_inflateEnd(strm)
41  Else rc = -EINVAL
44  kfree( memory allocated for this stream )
45  gunzip_nomem2 :
46  kfree(strm)
47  gunzip_nomem1 :
48  Return rc