Messages in this thread | | | Date | Thu, 27 Jun 2019 21:56:08 +0200 | From | Pavel Machek <> | Subject | Re: [PATCH 43/87] kernel: power: replace kmalloc and memset with kzalloc |
| |
On Fri 2019-06-28 01:40:48, Fuqian Huang wrote: > kmalloc + memset(0) -> kzalloc > > Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
> @@ -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 [unhandled content-type:application/pgp-signature] | |