Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753765AbdDKVZU (ORCPT ); Tue, 11 Apr 2017 17:25:20 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:31928 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753696AbdDKVZR (ORCPT ); Tue, 11 Apr 2017 17:25:17 -0400 Subject: Re: [PATCH 2/4] iommu/omap: Set dev->archdata.iommu = NULL in omap_iommu_remove_device To: Joerg Roedel , References: <1491576092-23339-1-git-send-email-joro@8bytes.org> <1491576092-23339-3-git-send-email-joro@8bytes.org> CC: , Joerg Roedel From: Suman Anna Message-ID: <224ed0a1-65f2-5a49-1959-bb88c51efb24@ti.com> Date: Tue, 11 Apr 2017 16:25:02 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1491576092-23339-3-git-send-email-joro@8bytes.org> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 749 Lines: 28 On 04/07/2017 09:41 AM, Joerg Roedel wrote: > From: Joerg Roedel > > Don't leave a stale pointer in case the device continues to > exist for some more time. > > Signed-off-by: Joerg Roedel Acked-by: Suman Anna > --- > drivers/iommu/omap-iommu.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c > index e9c9b08..08bd731 100644 > --- a/drivers/iommu/omap-iommu.c > +++ b/drivers/iommu/omap-iommu.c > @@ -1259,6 +1259,8 @@ static void omap_iommu_remove_device(struct device *dev) > if (!dev->of_node || !arch_data) > return; > > + dev->archdata.iommu = NULL; > + > kfree(arch_data->name); > kfree(arch_data); > } >