From: Wei Yang <weiyang@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Cc: aik@ozlabs.ru, paulus@au1.ibm.com, benh@au1.ibm.com,
Wei Yang <weiyang@linux.vnet.ibm.com>
Subject: [PATCH 1/2] iommu: Don't remove device when no iommu_group associated
Date: Fri, 16 Aug 2013 18:08:06 +0800 [thread overview]
Message-ID: <1376647687-20550-2-git-send-email-weiyang@linux.vnet.ibm.com> (raw)
In-Reply-To: <1376647687-20550-1-git-send-email-weiyang@linux.vnet.ibm.com>
In some cases, one device may not associated with any iommu_group.
For example, not enough DMA address space.
For those devices, kernel will crash when try to remove it from an iommu_group.
This patch do the check before remove it.
Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
---
drivers/iommu/iommu.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index fbe9ca7..fe41946 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -379,6 +379,9 @@ void iommu_group_remove_device(struct device *dev)
struct iommu_group *group = dev->iommu_group;
struct iommu_device *tmp_device, *device = NULL;
+ if (!group)
+ return;
+
/* Pre-notify listeners that a device is being removed. */
blocking_notifier_call_chain(&group->notifier,
IOMMU_GROUP_NOTIFY_DEL_DEVICE, dev);
--
1.7.5.4
next prev parent reply other threads:[~2013-08-16 10:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-16 10:08 [PATCH 0/2] powerpc/iommu: check dev->iommu_group before remove it Wei Yang
2013-08-16 10:08 ` Wei Yang [this message]
2013-08-16 10:08 ` [PATCH 2/2] powerpc/iommu: check dev->iommu_group before remove a device from iommu_group Wei Yang
2013-08-16 10:15 ` Alexey Kardashevskiy
2013-08-19 1:29 ` Wei Yang
2013-08-19 1:39 ` Alexey Kardashevskiy
2013-08-19 1:55 ` Wei Yang
2013-08-22 7:23 ` Alexey Kardashevskiy
2013-08-22 7:52 ` Wei Yang
2013-08-22 15:28 ` Alex Williamson
2013-08-22 15:41 ` Wei Yang
2013-08-22 16:17 ` Alex Williamson
2013-08-23 1:30 ` Wei Yang
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=1376647687-20550-2-git-send-email-weiyang@linux.vnet.ibm.com \
--to=weiyang@linux.vnet.ibm.com \
--cc=aik@ozlabs.ru \
--cc=benh@au1.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@au1.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).