Skip to content

Commit

Permalink
iommu/pamu: Use kzfree() in fsl_pamu_probe()
Browse files Browse the repository at this point in the history
Use kzfree() instead of opencoded memset with 0 followed by kfree().
Null check is not required since kzfree() checks for NULL internally.

Signed-off-by: Denis Efremov <efremov@linux.com>
Link: https://lore.kernel.org/r/20200604123709.96561-1-efremov@linux.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Denis Efremov authored and Joerg Roedel committed Jun 30, 2020
1 parent 9ebcfad commit f5e383a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/iommu/fsl_pamu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,10 +1174,7 @@ static int fsl_pamu_probe(struct platform_device *pdev)
if (irq != NO_IRQ)
free_irq(irq, data);

if (data) {
memset(data, 0, sizeof(struct pamu_isr_data));
kfree(data);
}
kzfree(data);

if (pamu_regs)
iounmap(pamu_regs);
Expand Down

0 comments on commit f5e383a

Please sign in to comment.