From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH v1 1/6] iommu/dmar: Fix crash on boot when DMAR is disabled Date: Wed, 22 Feb 2017 12:26:17 +0100 Message-ID: <20170222112617.GD4154@suse.de> References: <20170215144226.34519-1-andriy.shevchenko@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20170215144226.34519-1-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> 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: Andy Shevchenko Cc: Mika Westerberg , "Rafael J . Wysocki" , David Woodhouse , iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: iommu@lists.linux-foundation.org Hi Andy, On Wed, Feb 15, 2017 at 04:42:21PM +0200, Andy Shevchenko wrote: > By default CONFIG_INTEL_IOMMU_DEFAULT_ON is not set and thus > dmar_disabled variable is set. > > Intel IOMMU driver based on above doesn't set intel_iommu_enabled > variable. > > The commit b0119e870837 ("iommu: Introduce new 'struct iommu_device'") > mistakenly assumes it never happens and tries to unregister not ever > registered resources, which crashes the kernel at boot time: > > BUG: unable to handle kernel NULL pointer dereference at 0000000000000008 > IP: iommu_device_unregister+0x31/0x60 > > Make unregister procedure conditional in free_iommu(). > > Fixes: b0119e870837 ("iommu: Introduce new 'struct iommu_device'") > Cc: Joerg Roedel > Signed-off-by: Andy Shevchenko Thanks for the patch, I applied it and will send it upstream asap. Joerg