I am trying to implement a kernel module which uses zlib, so is there any Zlib module available for linux-2.6.17.8?. 

If I need to convert the source files of zlib to kernel space I need to replace malloc, function calls, assertions etc?