iommu/tegra: remove invalid reference to list iterator variable
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 8 Jul 2012 11:37:42 +0000 (13:37 +0200)
committerMrutyunjay Sawant <msawant@nvidia.com>
Fri, 19 Oct 2012 13:33:41 +0000 (06:33 -0700)
commit297b0599040343285eb3f72f238fe7d6ffef1fa7
treebd5226044fecc25816b6faaa67e1e1a8471d3d0f
parent940e29b814c9188818139bc8c08d18fcca2d4b3e
iommu/tegra: remove invalid reference to list iterator variable

If list_for_each_entry, etc complete a traversal of the
list, the iterator variable ends up pointing to an address
at an offset from the list head, and not a meaningful
structure.  Thus this value should not be used after the end
of the iterator.  Replace c->dev by dev, which is the value
that c->dev has been compared to.

This problem was found using Coccinelle (http://coccinelle.lip6.fr/).

Change-Id: Ic861eccf69869dd6a0301ed71dba2dbd2ebe4c23
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Hiroshi DOYU <hdoyu@nvidia.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Reviewed-on: http://git-master/r/140589
Reviewed-by: Mrutyunjay Sawant <msawant@nvidia.com>
Tested-by: Mrutyunjay Sawant <msawant@nvidia.com>
drivers/iommu/tegra-smmu.c