From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: [PATCH 2/2] iommu/vt-d: Check return value of acpi_bus_get_device() Date: Thu, 21 Aug 2014 15:57:08 -0600 Message-ID: <1408658228.2906.21.camel@ul30vt.home> References: <1408657045-4979-1-git-send-email-joro@8bytes.org> <1408657045-4979-3-git-send-email-joro@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1408657045-4979-3-git-send-email-joro-zLv9SwRftAIdnm+yROfE0A@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: Joerg Roedel Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Joerg Roedel , David Woodhouse , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: iommu@lists.linux-foundation.org On Thu, 2014-08-21 at 23:37 +0200, Joerg Roedel wrote: > From: Joerg Roedel > > Checking adev == NULL is not sufficient as > acpi_bus_get_device() might not touch the value of this > parameter in an error case, so check the return value > directly. > > Fixes: ed40356b5fcf1ce28e026ab39c5b2b6939068b50 > Cc: David Woodhouse > Signed-off-by: Joerg Roedel > --- > drivers/iommu/dmar.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c > index 60ab474..06d268a 100644 > --- a/drivers/iommu/dmar.c > +++ b/drivers/iommu/dmar.c > @@ -678,8 +678,7 @@ static int __init dmar_acpi_dev_scope_init(void) > andd->device_name); > continue; > } > - acpi_bus_get_device(h, &adev); > - if (!adev) { > + if (acpi_bus_get_device(h, &adev)) { > pr_err("Failed to get device for ACPI object %s\n", > andd->device_name); > continue; Reviewed-by: Alex Williamson