Commit 0326ccb5 authored by Thierry Reding's avatar Thierry Reding Committed by Greg Kroah-Hartman

xhci: tegra: Prevent error pointer dereference

During initialization, the host and super-speed power domains will
contain an ERR_PTR() encoded error code rather than being NULL. To
avoid a crash, use a !IS_ERR_OR_NULL() condition during cleanup.
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Fixes: 6494a9ad ("usb: xhci: tegra: Add genpd support")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: default avatarJon Hunter <jonathanh@nvidia.com>
Acked-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 79595a73
...@@ -941,9 +941,9 @@ static void tegra_xusb_powerdomain_remove(struct device *dev, ...@@ -941,9 +941,9 @@ static void tegra_xusb_powerdomain_remove(struct device *dev,
device_link_del(tegra->genpd_dl_ss); device_link_del(tegra->genpd_dl_ss);
if (tegra->genpd_dl_host) if (tegra->genpd_dl_host)
device_link_del(tegra->genpd_dl_host); device_link_del(tegra->genpd_dl_host);
if (tegra->genpd_dev_ss) if (!IS_ERR_OR_NULL(tegra->genpd_dev_ss))
dev_pm_domain_detach(tegra->genpd_dev_ss, true); dev_pm_domain_detach(tegra->genpd_dev_ss, true);
if (tegra->genpd_dev_host) if (!IS_ERR_OR_NULL(tegra->genpd_dev_host))
dev_pm_domain_detach(tegra->genpd_dev_host, true); dev_pm_domain_detach(tegra->genpd_dev_host, true);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment