dm: use vzalloc
Use vzalloc() instead of vmalloc()+memset(). Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
This commit is contained in:
committed by
Alasdair G Kergon
parent
6c9b27ab08
commit
e29e65aacb
@@ -153,9 +153,7 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size)
|
||||
return NULL;
|
||||
|
||||
size = nmemb * elem_size;
|
||||
addr = vmalloc(size);
|
||||
if (addr)
|
||||
memset(addr, 0, size);
|
||||
addr = vzalloc(size);
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
Reference in New Issue
Block a user