lkml.org 
[lkml]   [2019]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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]
\
 
 \ /
  Last update: 2019-06-27 21:56    [W:0.042 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site