summaryrefslogtreecommitdiff
path: root/drivers/usb/typec/mux/intel_pmc_mux.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/typec/mux/intel_pmc_mux.c')
-rw-r--r--drivers/usb/typec/mux/intel_pmc_mux.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c
index 17896bd87fc3..acdef6fbb85e 100644
--- a/drivers/usb/typec/mux/intel_pmc_mux.c
+++ b/drivers/usb/typec/mux/intel_pmc_mux.c
@@ -573,6 +573,11 @@ static int pmc_usb_probe_iom(struct pmc_usb *pmc)
return -ENOMEM;
}
+ if (IS_ERR(pmc->iom_base)) {
+ put_device(&adev->dev);
+ return PTR_ERR(pmc->iom_base);
+ }
+
pmc->iom_adev = adev;
return 0;
@@ -623,8 +628,10 @@ static int pmc_usb_probe(struct platform_device *pdev)
break;
ret = pmc_usb_register_port(pmc, i, fwnode);
- if (ret)
+ if (ret) {
+ fwnode_handle_put(fwnode);
goto err_remove_ports;
+ }
}
platform_set_drvdata(pdev, pmc);