From: Sebastian Ott <sebott-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
To: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
Joerg Roedel <jroedel-l3A5Bk7waGM@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Gerald Schaefer
<gerald.schaefer-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
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-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
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-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
---
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:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-09 10:25 [PATCH v3] iommu/s390: Add support for iommu_device handling Joerg Roedel
[not found] ` <1502274354-643-1-git-send-email-joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2017-08-10 19:07 ` Sebastian Ott
2017-08-10 21:24 ` Joerg Roedel
2017-08-11 7:31 ` Joerg Roedel
[not found] ` <20170811073118.GF30515-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
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-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
--cc=gerald.schaefer-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org \
--cc=jroedel-l3A5Bk7waGM@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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