Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753474AbdHKRT7 (ORCPT ); Fri, 11 Aug 2017 13:19:59 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:34456 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752723AbdHKRT5 (ORCPT ); Fri, 11 Aug 2017 13:19:57 -0400 Date: Fri, 11 Aug 2017 19:19:51 +0200 (CEST) From: Sebastian Ott X-X-Sender: sebott@schleppi To: Joerg Roedel cc: Gerald Schaefer , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Joerg Roedel Subject: Re: [PATCH v3] iommu/s390: Add support for iommu_device handling In-Reply-To: References: <1502274354-643-1-git-send-email-joro@8bytes.org> <20170811073118.GF30515@8bytes.org> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) Organization: =?ISO-8859-15?Q?=22IBM_Deutschland_Research_&_Development_GmbH_=2F_Vorsitzende_des_Aufsichtsrats=3A_Martina_Koederitz_Gesch=E4ftsf=FChrung=3A_Dirk_Wittkopp_Sitz_der_Gesellschaft=3A_B=F6blingen_=2F_Registergericht?= =?ISO-8859-15?Q?=3A_Amtsgericht_Stuttgart=2C_HRB_243294=22?= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-TM-AS-GCONF: 00 x-cbid: 17081117-0012-0000-0000-0000056EE7EB X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17081117-0013-0000-0000-000018E62DD9 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-08-11_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1708110268 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 501 Lines: 11 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