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 smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 50BBFC433F5 for ; Thu, 28 Apr 2022 09:39:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id DD28360D69; Thu, 28 Apr 2022 09:39:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Sgve4j9TyqCq; Thu, 28 Apr 2022 09:39:09 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id C0AB460D6D; Thu, 28 Apr 2022 09:39:08 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9B082C0039; Thu, 28 Apr 2022 09:39:08 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id DAA49C002D for ; Thu, 28 Apr 2022 09:39:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C3E08409DA for ; Thu, 28 Apr 2022 09:39:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XsYRZb1IgrHt for ; Thu, 28 Apr 2022 09:39:07 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from theia.8bytes.org (8bytes.org [81.169.241.247]) by smtp4.osuosl.org (Postfix) with ESMTPS id 2046F40894 for ; Thu, 28 Apr 2022 09:39:07 +0000 (UTC) Received: by theia.8bytes.org (Postfix, from userid 1000) id 46ED12FB; Thu, 28 Apr 2022 11:39:04 +0200 (CEST) Date: Thu, 28 Apr 2022 11:39:03 +0200 From: Joerg Roedel To: Yang Yingliang Subject: Re: [PATCH] iommu/dart: check return value after calling platform_get_resource() Message-ID: References: <20220425090826.2532165-1-yangyingliang@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220425090826.2532165-1-yangyingliang@huawei.com> Cc: iommu@lists.linux-foundation.org, will@kernel.org, linux-kernel@vger.kernel.org, alyssa@rosenzweig.io X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Mon, Apr 25, 2022 at 05:08:26PM +0800, Yang Yingliang wrote: > It will cause null-ptr-deref in resource_size(), if platform_get_resource() > returns NULL, move calling resource_size() after devm_ioremap_resource() that > will check 'res' to avoid null-ptr-deref. > And use devm_platform_get_and_ioremap_resource() to simplify code. > > Fixes: 46d1fb072e76 ("iommu/dart: Add DART iommu driver") > Signed-off-by: Yang Yingliang > --- > drivers/iommu/apple-dart.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) Applied to iommu/fixes, thanks. _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu