On Fri, May 05, 2017 at 02:08:37PM -0400, Rob Clark wrote:
> It looks like it *used* to make sense to free the device. But now it is
> embedded in 'struct iommu' (which is allocated or embedded in something
> that the device allocated).
>
> Spotted when testing qcom_iommu with CONFIG_DEBUG_TEST_DRIVER_REMOVE.
>
> Fixes: 39ab955 ("iommu: Add sysfs bindings for struct iommu_device")
> Signed-off-by: Rob Clark <[email protected]>
> ---
> drivers/iommu/iommu-sysfs.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/iommu/iommu-sysfs.c b/drivers/iommu/iommu-sysfs.c
> index c58351e..ad19cbb 100644
> --- a/drivers/iommu/iommu-sysfs.c
> +++ b/drivers/iommu/iommu-sysfs.c
> @@ -34,7 +34,6 @@ static const struct attribute_group *iommu_dev_groups[] = {
>
> static void iommu_release_device(struct device *dev)
> {
> - kfree(dev);
> }
As per the documentation in the kernel tree, I now get to make fun of
you for doing such a crazh and foolish thing!
Come on, don't do that, a release function _HAS_ to free the memory
involved. If not, then it is really broken...
greg k-h
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu