]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
iommu/tegra: smmu: fix issue with detach_dev
authorSri Krishna chowdary <schowdary@nvidia.com>
Thu, 21 Aug 2014 06:37:59 +0000 (12:07 +0530)
committerBharat Nihalani <bnihalani@nvidia.com>
Mon, 25 Aug 2014 17:22:02 +0000 (10:22 -0700)
While detaching a device, make sure the debugfs_root of client
is marked as NULL. In case the device re-attaches itself with SMMU,
the stale pointer from debugfs_root will be used to create debugfs
and can cause kernel panic.

Bug 1546169
Bug 200031739

Change-Id: If0f58e4106ca2fe4b761c7fe185b17272824f76d
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/486335
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Hiroshi Doyu <hdoyu@nvidia.com>
Tested-by: Hiroshi Doyu <hdoyu@nvidia.com>
drivers/iommu/tegra-smmu.c

index 7f76d565ad025c8b76c8abcef9592b2743f57b51..8426804cd6f1121f6876bbfcdf87405e61e38c83 100644 (file)
@@ -1913,6 +1913,7 @@ static void smmu_iommu_detach_dev(struct iommu_domain *domain,
        list_for_each_entry(c, &as->client, list) {
                if (c->dev == dev) {
                        debugfs_remove_recursive(c->debugfs_root);
+                       c->debugfs_root = NULL;
                        list_del(&c->list);
                        smmu_client_disable_hwgrp(c);
                        dev_dbg(smmu->dev,