From: Sebastian Ott Subject: Re: [PATCH v3] iommu/s390: Add support for iommu_device handling Date: Fri, 11 Aug 2017 19:19:51 +0200 (CEST) Message-ID: References: <1502274354-643-1-git-send-email-joro@8bytes.org> <20170811073118.GF30515@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Joerg Roedel Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Joerg Roedel , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Gerald Schaefer List-Id: iommu@lists.linux-foundation.org On Fri, 11 Aug 2017, Sebastian Ott wrote: > * That patch embedded a struct iommu_device within struct zpci_dev but > the iommu_device has a release function (via its class) - so when > the release function gets called it frees memory that was never allocated. > The fix is to not embedd struct iommu_device in zpci_dev (see below) While discussing the problem with Gerald he noticed that struct iommu_device is embedded in other structs. So that is potentially broken in other cases, too. Sebastian