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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EDBDC433EF for ; Tue, 26 Apr 2022 20:22:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355063AbiDZUZh (ORCPT ); Tue, 26 Apr 2022 16:25:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353740AbiDZUZf (ORCPT ); Tue, 26 Apr 2022 16:25:35 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C056506C3 for ; Tue, 26 Apr 2022 13:22:27 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 794575C00F8; Tue, 26 Apr 2022 16:22:26 -0400 (EDT) Received: from imap47 ([10.202.2.97]) by compute2.internal (MEProxy); Tue, 26 Apr 2022 16:22:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svenpeter.dev; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1651004546; x= 1651090946; bh=U9DAiEYbrUd9tFuzbQeFQ00nB7pzlike5TcMqRrzras=; b=y C+vjIVy2d9e7Sp46ooWs2Kf2JARy6m6H0M3Xd867jqFUFrWAub+aj7SmwPvDRvls 1DHyHII593Q4xvg4Xy2tMprzaDtRY2ZkIFmeWOhKe0+MFXAVSJfxQIEFXjaer0yQ 41QVqTL3P2wgPbde/8FgEnD/EF/aCeXOQp3Ip8ZxHT8TS21nm9z5kIfGiKZRifau JbQgApmxegzLS83kaQkNkL1STmnPP3YkFHu6D8Yvi1Jk0HnSuQvAEAgykmKH5uGX oEDZY90QlHxxv9EGEH7kGoNXBg3FNYrTS0NCYQ66bDNivt71VkzjkvDJZg1xa44z qc8ULf5+Q02xvSWoh799w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1651004546; x=1651090946; bh=U9DAiEYbrUd9t FuzbQeFQ00nB7pzlike5TcMqRrzras=; b=j+A319KTz1azrMQcygW79Tcn4Ddw5 mZulvNtYgdmTUoanzc5l51g0ypyiFKmJbgBQ7jTvgwemimfZhnt+8+M4aNyCPzoh BraX414CEZ/UBPmHexd9g75WKbpGdaqCTqJ04YstqKUTpYP3KEMl9Q2adYVRN/sI njmyc0Ocdkr448o9YI6pQrRl9u4zPNbbBkZhnOi6bsMS052eJ3JxbY/So1rgNaHG y6NqX1+lmlNgO2/oG3bBcLtxWCdaP88KRnJKHgeoR6hzP1K7DAC5lqxc2W4tU31U JYeP6V17IpwfNz2Z1c7TNDTrBBAXSoUwDJZSqYZVe4IYh3KIELKkHoT4g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudefgddugeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqmhdtreerjeenucfhrhhomhepfdfu vhgvnhcurfgvthgvrhdfuceoshhvvghnsehsvhgvnhhpvghtvghrrdguvghvqeenucggtf frrghtthgvrhhnpefgveevteefveekteffhfejgfevheetffejgeehgfejfeetledtjeeg ffejuefhveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsvhgvnhesshhvvghnphgvthgvrhdruggvvh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 014402740386; Tue, 26 Apr 2022 16:22:25 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-569-g7622ad95cc-fm-20220421.002-g7622ad95 Mime-Version: 1.0 Message-Id: In-Reply-To: <20220425090826.2532165-1-yangyingliang@huawei.com> References: <20220425090826.2532165-1-yangyingliang@huawei.com> Date: Tue, 26 Apr 2022 22:22:05 +0200 From: "Sven Peter" To: "Yang Yingliang" Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, will@kernel.org, joro@8bytes.org, alyssa@rosenzweig.io Subject: Re: [PATCH] iommu/dart: check return value after calling platform_get_resource() Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 25. Apr 2022, at 10:56, Yang Yingliang w= rote: >=20 > =EF=BB=BFIt 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. >=20 > Fixes: 46d1fb072e76 ("iommu/dart: Add DART iommu driver") > Signed-off-by: Yang Yingliang Reviewed-by: Sven Peter Thanks, Sven