diff mbox series

[v2,2/3] usb: typec: intel_pmc_mux: Add missed error check for devm_ioremap_resource()

Message ID 20210607205007.71458-2-andy.shevchenko@gmail.com (mailing list archive)
State Accepted
Commit 843fabdd7623271330af07f1b7fbd7fabe33c8de
Headers show
Series [v2,1/3] usb: typec: intel_pmc_mux: Put fwnode in error case during ->probe() | expand

Commit Message

Andy Shevchenko June 7, 2021, 8:50 p.m. UTC
devm_ioremap_resource() can return an error, add missed check for it.

Fixes: 43d596e32276 ("usb: typec: intel_pmc_mux: Check the port status before connect")
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
v2: added Rb tag (Heikki)
 drivers/usb/typec/mux/intel_pmc_mux.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c
index 221aa1c0e77a..34e1662ad6ef 100644
--- a/drivers/usb/typec/mux/intel_pmc_mux.c
+++ b/drivers/usb/typec/mux/intel_pmc_mux.c
@@ -604,6 +604,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;