usb: typec: intel_pmc_mux: Add missed error check for devm_ioremap_resource()

devm_ioremap_resource() can return an error, add missed check for it.

Fixes: 43d596e322 ("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>
This commit is contained in:
Andy Shevchenko 2021-06-07 23:50:06 +03:00 committed by Greg Kroah-Hartman
parent 1a85b350a7
commit 843fabdd76

View File

@ -586,6 +586,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;