ptp_pch: release chip->mem_base and chip->regs on error
Subsystems (2)
PATCH 1/1 ptp_pch: release chip->mem_base and chip->regs on error
Fix smatch warnings catched by Fengguang's 0-DAY system:
+ drivers/ptp/ptp_pch.c:641 pch_probe() warn: 'chip->mem_base' was not released on error
+ drivers/ptp/ptp_pch.c:641 pch_probe() warn: 'chip->regs' was not released on error
Cc Richard Cochran <[email protected]>
Cc David S. Miller <[email protected]>
Signed-off-by Yuanhan Liu <[email protected]>
--- drivers/ptp/ptp_pch.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
drivers/ptp/ptp_pch.c +5 -2
@@ -629,8 +629,10 @@ pch_probe(struct pci_dev *pdev, const struct pci_device_id *id) chip->caps = ptp_pch_caps; chip->ptp_clock =ptp_clock_register (&chip->caps, &pdev->dev); -if (IS_ERR (chip->ptp_clock)) -return PTR_ERR (chip->ptp_clock); +if (IS_ERR (chip->ptp_clock)) { + ret =PTR_ERR (chip->ptp_clock); + goto err_ptp_clock; + }spin_lock_init (&chip->register_lock);
@@ -669,6 +671,7 @@ pch_probe(struct pci_dev *pdev, const struct pci_device_id *id) err_req_irq:ptp_clock_unregister (chip->ptp_clock); +err_ptp_clock:iounmap (chip->regs); chip->regs =0 ;
Signature · 1 line
1.7.7.6
Quoted 7 lines · Yuanhan Liu
Fix smatch warnings catched by Fengguang's 0-DAY system:
+drivers/ptp/ptp_pch.c:641pch_probe()warn: 'chip->mem_base' was not released on error
+drivers/ptp/ptp_pch.c:641pch_probe()warn: 'chip->regs' was not released on errorCc Richard Cochran <[email protected]>Cc David S. Miller <[email protected]>Signed-off-by Yuanhan Liu <[email protected]>
Acked-by Richard Cochran <[email protected]>