Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp988332rwd; Thu, 8 Jun 2023 10:20:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zDcuW+0NaZAVM/Si7OPgokbHSkLPAxPoLvJVFKWZNzxtgEkacm2yC8rZCLGWfjyGWp4dI X-Received: by 2002:a05:6a00:150f:b0:663:18c:a176 with SMTP id q15-20020a056a00150f00b00663018ca176mr3400600pfu.32.1686244817263; Thu, 08 Jun 2023 10:20:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686244817; cv=none; d=google.com; s=arc-20160816; b=pbtmsOXDIItNarlTnTnChIQH97t5a0HUbQWSyEH5b+2uQMNxtlBuPBVx56eWMNSYgp ex0jlZZIljqVtrcxweteZR3BV9IIBSWozzWhm3qN4yHhNmWFxxcjlbwXqAnFa8r/1Hdv JXA01ACcKEYk2dN5O3x4cOaJphHN3RA3LOEYtzGrm6S2TuWMFtsvSgqvdpUTpc/h61Hg jpg8X8mpIlotndqbjrtc5YhlASnNC8384ezJleAY7pOcFKQpVmTHUkctrzaG4v6P7OlD ah/V3jclylHWSrCISVeWV2WtDdK9jARzGvM1Bcuo2oor2tRdI2IXWK6NarYefWDhVDep mOQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2W3bEvKGgjzaF4n+m2IQklO6tsTeaqUnIN5svkFmfFM=; b=FtnPtKzZEOGcE9qCgjJW09j3V6JcCIPtdmQoXsWrdcgmwVSNnN7HNxh+xQ0ppa8ili WmoXKh9SGNMebgI/dB68IkW066OyguJmucIUAsEgbeCOiGvCNEXVeyYBeLlbJSg5gR3W YFGQdjsD90sNQqK2nquXfpNwEom3k8sZ4ZibmjF+AbRPzeeOTE0RLCzEQVSTc+l3bWU1 O3OltAwchC8Y70z6NPRCU+x9HpjgyCcHG3Bc4+P5fe5vzhJ9LaDgjkNboiR05PQ9Mvbj tTkaJhoLhZHeJnb3MeKbdsmTQFdPkOtJoDgEJAEtTx4EoxPDCaqRcIzCA7VVkknuoGtQ flTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lwuELfVC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w5-20020aa79545000000b0064d425629dfsi1139365pfq.51.2023.06.08.10.20.00; Thu, 08 Jun 2023 10:20:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lwuELfVC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236229AbjFHROg (ORCPT + 99 others); Thu, 8 Jun 2023 13:14:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231959AbjFHROe (ORCPT ); Thu, 8 Jun 2023 13:14:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E62DEE59 for ; Thu, 8 Jun 2023 10:14:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7030964F81 for ; Thu, 8 Jun 2023 17:14:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35C1AC433D2; Thu, 8 Jun 2023 17:14:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686244472; bh=R1L6b3wgbiK874cLJ3MogGauggBNR+aYC0k6slCiep0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lwuELfVCtQW00XSO3oJ3XcVCV5ox+/2z8vUhaiNl81TKhQuZE+PMEORvkviZ4n4mS gC6Lhy3XyugFnER6NKGbV1FNAEkopXMWFHawmR9+W1t/kdHsvttMWCh4HgskqrKD5m J5dkpV8DY70/GNEgVRtRsYUyU6znpXEGpqblJTsT2XN3VDRxryQwO1W6Vb78vkNGix ovGkh77TUHpgliwWHhd7tJuAVs+XXXuEbPkoWeQso6xv08lz2e1xx+dCpr0wwc+z9q Pj4Xu5/NOXcR/1Ae2OjhZODxEanNyrMXv2rN+InBkTkIY2IsCRBeltq/QGZrQ3ScI4 vrI0Jd94teIlQ== Date: Thu, 8 Jun 2023 18:14:29 +0100 From: Lee Jones To: Jiasheng Jiang Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] mfd: intel-lpss: Add missing check for platform_get_resource Message-ID: <20230608171429.GF3572061@google.com> References: <20230531100257.17769-1-jiasheng@iscas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230531100257.17769-1-jiasheng@iscas.ac.cn> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 31 May 2023, Jiasheng Jiang wrote: > Add the missing check for platform_get_resource and return error > if it fails. > > Fixes: 4b45efe85263 ("mfd: Add support for Intel Sunrisepoint LPSS devices") > Signed-off-by: Jiasheng Jiang > --- > drivers/mfd/intel-lpss-acpi.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c > index a143c8dca2d9..1a6ebd3d9795 100644 > --- a/drivers/mfd/intel-lpss-acpi.c > +++ b/drivers/mfd/intel-lpss-acpi.c > @@ -183,6 +183,9 @@ static int intel_lpss_acpi_probe(struct platform_device *pdev) > return -ENOMEM; > > info->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + if (!info->mem) > + return -ENOMEM; This does not mean we're out of memory. Please use either -EINVAL or -ENODEV. > + > info->irq = platform_get_irq(pdev, 0); > > ret = intel_lpss_probe(&pdev->dev, info); > -- > 2.25.1 > -- Lee Jones [李琼斯]