drm/tegra: Properly cleanup and zero out resources
authorThierry Reding <treding@nvidia.com>
Mon, 14 Oct 2013 12:06:02 +0000 (14:06 +0200)
committerThierry Reding <treding@nvidia.com>
Thu, 31 Oct 2013 08:55:40 +0000 (09:55 +0100)
commitf002abc19acb6f7cdb3d320f3b6f1a565c0be63e
tree62a5882eb9ea6ab7d913a99a7a2c5db607f5a164
parentdee8268f8fb218c9e9b604a40f7dbdd395e910f9
drm/tegra: Properly cleanup and zero out resources

When the DRM driver is unloaded, all the associated resources must be
cleaned up and zeroed out. This is necessary because of the architecture
of the Tegra DRM driver, where not all subdrivers are unloaded along
with the DRM driver. Therefore device-managed managed won't be freed and
memory cannot be assumed to have been cleared (because it hasn't been
reallocated using kzalloc()) by the time the DRM driver is reloaded. It
is therefore necessary to zero out the structures to prevent strange
errors (such as slab corruptions) from occurring.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/dc.c
drivers/gpu/drm/tegra/drm.c
drivers/gpu/drm/tegra/output.c