smalloc: smalloc() already clears memory, scalloc() need not do it again
authorJens Axboe <axboe@fb.com>
Fri, 3 Jul 2015 17:47:10 +0000 (11:47 -0600)
committerJens Axboe <axboe@fb.com>
Fri, 3 Jul 2015 17:47:10 +0000 (11:47 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
smalloc.c

index 6bf66fc..8412e75 100644 (file)
--- a/smalloc.c
+++ b/smalloc.c
@@ -492,13 +492,7 @@ void *smalloc(size_t size)
 
 void *scalloc(size_t nmemb, size_t size)
 {
-       void *ret;
-
-       ret = smalloc(nmemb * size);
-       if (ret)
-               memset(ret, 0, nmemb * size);
-
-       return ret;
+       return smalloc(nmemb * size);
 }
 
 char *smalloc_strdup(const char *str)