summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorAndy Shevchenko <andy.shevchenko@gmail.com>2021-06-07 23:50:06 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-06-16 12:01:42 +0200
commit0b3bb7950e73e46e7a697f35f893d115c55760ec (patch)
tree8f60dec8324e2851d94aa8c9f77ef8c98eb4adec /drivers/usb
parent6900ef1b1095e2ffa6538895017a5408e4706e34 (diff)
usb: typec: intel_pmc_mux: Add missed error check for devm_ioremap_resource()
commit 843fabdd7623271330af07f1b7fbd7fabe33c8de upstream. 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") Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20210607205007.71458-2-andy.shevchenko@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/typec/mux/intel_pmc_mux.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c
index f6eaa7e30d54..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;