diff options
author | Jon Hunter <jonathanh@nvidia.com> | 2016-02-11 18:03:20 (GMT) |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2016-04-05 13:22:43 (GMT) |
commit | 0259f522e04f19b433a4dc7586d80da106afbbcc (patch) | |
tree | 62ddcf85d62475e39b17906af518553e2d304fca /certs | |
parent | 668419afe65c146e115897e8fef6ca23c48bf121 (diff) | |
download | linux-0259f522e04f19b433a4dc7586d80da106afbbcc.tar.xz |
soc/tegra: pmc: Restore base address on probe failure
During early initialisation, the PMC registers are mapped and the PMC SoC
data is populated in the PMC data structure. This allows other drivers
access the PMC register space, via the public Tegra PMC APIs, prior to
probing the PMC device.
When the PMC device is probed, the PMC registers are mapped again and if
successful the initial mapping is freed. If the probing of the PMC device
fails after the registers are remapped, then the registers will be
unmapped and hence the pointer to the PMC registers will be invalid. This
could lead to a potential crash, because once the PMC SoC data pointer is
populated, the driver assumes that the PMC register mapping is also valid
and a user calling any of the public Tegra PMC APIs could trigger an
exception because these APIs don't check that the mapping is still valid.
Fix this by updating the mapping and freeing the original mapping only if
probing the PMC device is successful.
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'certs')
0 files changed, 0 insertions, 0 deletions