Skip to content

Commit f336422

Browse files
JingJing1016kuba-moo
authored andcommitted
ptp_qoriq: fix memory leak in probe()
Smatch complains that: drivers/ptp/ptp_qoriq.c ptp_qoriq_probe() warn: 'base' from ioremap() not released. Fix this by revising the parameter from 'ptp_qoriq->base' to 'base'. This is only a bug if ptp_qoriq_init() returns on the first -ENODEV error path. For other error paths ptp_qoriq->base and base are the same. And this change makes the code more readable. Fixes: 7f4399b ("ptp_qoriq: fix NULL access if ptp dt node missing") Signed-off-by: SongJingyi <[email protected]> Reviewed-by: Dan Carpenter <[email protected]> Reviewed-by: Dongliang Mu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 3bced31 commit f336422

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/ptp/ptp_qoriq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ static int ptp_qoriq_probe(struct platform_device *dev)
637637
return 0;
638638

639639
no_clock:
640-
iounmap(ptp_qoriq->base);
640+
iounmap(base);
641641
no_ioremap:
642642
release_resource(ptp_qoriq->rsrc);
643643
no_resource:

0 commit comments

Comments
 (0)