From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3BF5FC433EF for ; Thu, 7 Apr 2022 05:40:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=x/Dwf6qYPdoVC1vGBY32L/XsjkqifgyGgG6F2s3mPkg=; b=Y6I4m3x7aRKzwZ FSjHzQUdYpF4KGgdE4DXooN1LccRBsr47VRsPeaq2tiidGstFf+18Uc4Q2AzT3x/cpAjGzVyWKKTe pU5MXvKa3HRigCMIL8+BWOqQQIiTy1osdv8BN6ZTw/2LASWDZ1DTjT8I3jZeRKIzsFnB1kO0Mecnb y9S0Mf5f2U2DlBMZ7BmCd0RAyUyoJ6jtkvEN4QuNvhshthFZAGSLUmLpSRbIGTgrCDXVvt0stUZOj cFWIpRo8d+pEEWSn4qtPzQDrB9R2A0TQ213O8kmNDKkhQCMinN86JhMKfreBzVl5I09Ea6G+Nk4WC 4uAzp06uVV7PSaNk2UpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncKrT-009a5v-NF; Thu, 07 Apr 2022 05:39:15 +0000 Received: from muru.com ([72.249.23.125]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncKrQ-009a4O-DF for linux-arm-kernel@lists.infradead.org; Thu, 07 Apr 2022 05:39:13 +0000 Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 18A668138; Thu, 7 Apr 2022 05:36:44 +0000 (UTC) Date: Thu, 7 Apr 2022 08:39:05 +0300 From: Tony Lindgren To: Joerg Roedel , Will Deacon Subject: Re: [PATCH] iommu/omap: Fix regression in probe for NULL pointer dereference Message-ID: References: <20220331062301.24269-1-tony@atomide.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220331062301.24269-1-tony@atomide.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220406_223912_528103_743EBAAD X-CRM114-Status: GOOD ( 18.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-omap@vger.kernel.org, Drew Fustini , Jason Gunthorpe , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, Lu Baolu Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, * Tony Lindgren [220331 09:21]: > Commit 3f6634d997db ("iommu: Use right way to retrieve iommu_ops") started > triggering a NULL pointer dereference for some omap variants: > > __iommu_probe_device from probe_iommu_group+0x2c/0x38 > probe_iommu_group from bus_for_each_dev+0x74/0xbc > bus_for_each_dev from bus_iommu_probe+0x34/0x2e8 > bus_iommu_probe from bus_set_iommu+0x80/0xc8 > bus_set_iommu from omap_iommu_init+0x88/0xcc > omap_iommu_init from do_one_initcall+0x44/0x24 > > This is caused by omap iommu probe returning 0 instead of ERR_PTR(-ENODEV) > as noted by Jason Gunthorpe . > > Looks like the regression already happened with an earlier commit > 6785eb9105e3 ("iommu/omap: Convert to probe/release_device() call-backs") > that changed the function return type and missed converting one place. Can you guys please get this fix into the -rc series? Or ack it so I can pick it up into my fixes branch? Without this fix booting is failing for a bunch of devices. Regards, Tony > Cc: Drew Fustini > Cc: Lu Baolu > Cc: Suman Anna > Suggested-by: Jason Gunthorpe > Fixes: 6785eb9105e3 ("iommu/omap: Convert to probe/release_device() call-backs") > Fixes: 3f6634d997db ("iommu: Use right way to retrieve iommu_ops") > Signed-off-by: Tony Lindgren > --- > drivers/iommu/omap-iommu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c > --- a/drivers/iommu/omap-iommu.c > +++ b/drivers/iommu/omap-iommu.c > @@ -1661,7 +1661,7 @@ static struct iommu_device *omap_iommu_probe_device(struct device *dev) > num_iommus = of_property_count_elems_of_size(dev->of_node, "iommus", > sizeof(phandle)); > if (num_iommus < 0) > - return 0; > + return ERR_PTR(-ENODEV); > > arch_data = kcalloc(num_iommus + 1, sizeof(*arch_data), GFP_KERNEL); > if (!arch_data) > -- > 2.35.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel