From: Marek Vasut Date: Fri, 8 Jun 2012 19:28:34 +0200 Subject: [U-Boot] [PATCH RESEND] Fix misuse of calloc() in linux/compat.h header Message-ID: <1339176514-13137-1-git-send-email-marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Quote from the manpage: [...] void *calloc(size_t nmemb, size_t size); [...] DESCRIPTION [...] The calloc() function allocates memory for an array of nmemb elements of size bytes each and returns a pointer to the allocated memory. The memory is set to zero. If nmemb or size is 0, then calloc() returns either NULL, or a unique pointer value that can later be successfully passed to free(). Signed-off-by: Marek Vasut Cc: Wolfgang Denk --- include/linux/compat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/compat.h b/include/linux/compat.h index 593b07f..9a9d7b0 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -18,7 +18,7 @@ #define KERN_DEBUG #define kmalloc(size, flags) malloc(size) -#define kzalloc(size, flags) calloc(size, 1) +#define kzalloc(size, flags) calloc(1, size) #define vmalloc(size) malloc(size) #define kfree(ptr) free(ptr) #define vfree(ptr) free(ptr) -- 1.7.10