Skip to content

Commit

Permalink
misc: Use kzalloc() instead of kmalloc() with flag GFP_ZERO.
Browse files Browse the repository at this point in the history
Use kzalloc instead of manually setting kmalloc
with flag GFP_ZERO since kzalloc sets allocated memory
to zero.

Signed-off-by: Huang Zijiang <huang.zijiang@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
Link: https://lore.kernel.org/r/1581501247-5479-1-git-send-email-wang.yi59@zte.com.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Huang Zijiang authored and Greg Kroah-Hartman committed Feb 14, 2020
1 parent 1031eb9 commit 06e3359
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/misc/mic/host/mic_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ static void *__mic_dma_alloc(struct device *dev, size_t size,
struct scif_hw_dev *scdev = dev_get_drvdata(dev);
struct mic_device *mdev = scdev_to_mdev(scdev);
dma_addr_t tmp;
void *va = kmalloc(size, gfp | __GFP_ZERO);
void *va = kzalloc(size, gfp);

if (va) {
tmp = mic_map_single(mdev, va, size);
Expand Down

0 comments on commit 06e3359

Please sign in to comment.