On Fri 2019-06-28 01:40:48, Fuqian Huang wrote:
> kmalloc + memset(0) -> kzalloc
> 
> Signed-off-by: Fuqian Huang <[email protected]>

Acked-by: Pavel Machek <[email protected]>

> @@ -974,12 +974,11 @@ static int get_swap_reader(struct swap_map_handle 
> *handle,
>       last = handle->maps = NULL;
>       offset = swsusp_header->image;
>       while (offset) {
> -             tmp = kmalloc(sizeof(*handle->maps), GFP_KERNEL);
> +             tmp = kzalloc(sizeof(*handle->maps), GFP_KERNEL);
>               if (!tmp) {
>                       release_swap_reader(handle);
>                       return -ENOMEM;
>               }
> -             memset(tmp, 0, sizeof(*tmp));
>               if (!handle->maps)
>                       handle->maps = tmp;
>               if (last)

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Attachment: signature.asc
Description: Digital signature

Reply via email to