Skip to content

Commit

Permalink
lib/scatterlist.c: avoid a double memset
Browse files Browse the repository at this point in the history
'sgl' is zeroed a few lines below in 'sg_init_table()'. There is no need to
clear it twice.

Remove the redundant initialization.

Signed-off-by: Christophe JAILLET <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
tititiou36 authored and torvalds committed Oct 16, 2020
1 parent 3264cee commit 6ed9b92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/scatterlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ struct scatterlist *sgl_alloc_order(unsigned long long length,
nalloc++;
}
sgl = kmalloc_array(nalloc, sizeof(struct scatterlist),
(gfp & ~GFP_DMA) | __GFP_ZERO);
gfp & ~GFP_DMA);
if (!sgl)
return NULL;

Expand Down

0 comments on commit 6ed9b92

Please sign in to comment.