From: Sebastian Ott <sebott@linux.vnet.ibm.com>
To: Joerg Roedel <joro@8bytes.org>
Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>,
iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
Joerg Roedel <jroedel@suse.de>
Subject: Re: [PATCH v3] iommu/s390: Add support for iommu_device handling
Date: Fri, 11 Aug 2017 19:11:53 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.20.1708111909480.1769@schleppi> (raw)
In-Reply-To: <alpine.LFD.2.20.1708111844340.1769@schleppi>
On Fri, 11 Aug 2017, Sebastian Ott wrote:
> * iommu_release_device must not release the struct device but the
> structure it is embedded in: struct iommu_device (I'll send a patch
> for that)
--->8
>From 2839c92e038af47b8cb569f84d571878c54d1815 Mon Sep 17 00:00:00 2001
From: Sebastian Ott <sebott@linux.vnet.ibm.com>
Date: Fri, 11 Aug 2017 19:04:00 +0200
Subject: [PATCH] iommu: fix the release function of iommu_class
The release function of iommu_class must not only free the device
structure it gets called with but the whole structure the device
is embedded in - struct iommu_device.
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
---
drivers/iommu/iommu-sysfs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/iommu-sysfs.c b/drivers/iommu/iommu-sysfs.c
index c58351e..b65a501 100644
--- a/drivers/iommu/iommu-sysfs.c
+++ b/drivers/iommu/iommu-sysfs.c
@@ -34,7 +34,9 @@ static const struct attribute_group *iommu_dev_groups[] = {
static void iommu_release_device(struct device *dev)
{
- kfree(dev);
+ struct iommu_device *iommu = container_of(dev, struct iommu_device, dev);
+
+ kfree(iommu);
}
static struct class iommu_class = {
--
2.5.5
next prev parent reply other threads:[~2017-08-11 17:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-09 10:25 Joerg Roedel
2017-08-10 19:07 ` Sebastian Ott
2017-08-10 21:24 ` Joerg Roedel
2017-08-11 7:31 ` Joerg Roedel
2017-08-11 17:02 ` Sebastian Ott
2017-08-11 17:11 ` Sebastian Ott [this message]
2017-08-11 17:19 ` Sebastian Ott
2017-08-14 16:24 ` Joerg Roedel
2017-08-15 16:02 ` Sebastian Ott
2017-08-15 16:10 ` Joerg Roedel
2017-08-15 16:12 ` Sebastian Ott
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.20.1708111909480.1769@schleppi \
--to=sebott@linux.vnet.ibm.com \
--cc=gerald.schaefer@de.ibm.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=jroedel@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®