mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-03 16:16:39 +07:00
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: Thierry Reding <treding@nvidia.com>
Fixes: 6494a9ad86
("usb: xhci: tegra: Add genpd support")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
79595a734a
commit
0326ccb5fe
@ -941,9 +941,9 @@ static void tegra_xusb_powerdomain_remove(struct device *dev,
|
||||
device_link_del(tegra->genpd_dl_ss);
|
||||
if (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);
|
||||
if (tegra->genpd_dev_host)
|
||||
if (!IS_ERR_OR_NULL(tegra->genpd_dev_host))
|
||||
dev_pm_domain_detach(tegra->genpd_dev_host, true);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user