Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp636485rwd; Wed, 31 May 2023 03:20:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4PafEm3lJifdKLTO5dV/0Wu77C5Hcjm7b7GCDuT+uzJsmLfQ+8/aFw3zHaO6Gg7VPTBojl X-Received: by 2002:a17:90a:bb87:b0:255:f113:48f4 with SMTP id v7-20020a17090abb8700b00255f11348f4mr4258933pjr.24.1685528457367; Wed, 31 May 2023 03:20:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685528457; cv=none; d=google.com; s=arc-20160816; b=Wj4LC2PSR5R6l7rAK5yUiuMNKZlJDisVDmJ+HIAv71y/+oC8PdRlYaDJybK52rYaqi mq90Pb6X8Ngpf8OebUrMSSWkP81Zv1hPUlvAoV0Mg/qxatSBnTWy8lSuOnmkg2cwi8S+ i0Qk1YnT4B9rWtEdL9FoTSZ7Z23ySkS6vpT8yaMSkSHrCljhgd2ChOGkZz2Glg/0e0sk 2D93DLy0xil7P5G6UjWZ0eC1p81I6oxIWqnZRrqclTMWAlyZtYQTR2IxLbe2CGzdJqzx H8J4XGm2iNpepVNn0XFREQf/YF3a4mr6/YU0rh3m+pM/EuwWEWJ8C2qb8jraJ0r8/C+g Yn+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=WFod7Pe9o2qt71SyRVgNB5EPwyQ5y+Fa6K8fxPKpLvA=; b=l0MSeWk3RQwncSKndaS99hiCe+3ydxt5AvpTj5c6ibQyxvipJZe43qvxLFAezhoh+v h9wpnZI4CIs0zDCJfh6PlA9xglKQG/XNIv4eR0XNAhMwNFV5kFgr1ZVfBdY6ENdLrEPc AXYGQRO+cuNjeEya3v3y8CfeCW0pwdsdPOdHHttum+g+d8Xj7j99Z4h3eCPqpDJFyITe gJk4HWWPvx1t6ipqaUVPzizcL+a9gKsPJhei2VvT3KdhjQDGKygmq6Za5pdSgUvM/iA0 3HoDUET8Dw+XX4Z8qcaN/9ed02aNpL35IG+QMAjhE7OMq+kPo7x+rl3W4fxnH1cYKb+F WN7A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e24-20020a17090a9a9800b002562afbd76esi319255pjp.151.2023.05.31.03.20.45; Wed, 31 May 2023 03:20:57 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235750AbjEaKDT (ORCPT + 99 others); Wed, 31 May 2023 06:03:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235747AbjEaKDR (ORCPT ); Wed, 31 May 2023 06:03:17 -0400 Received: from cstnet.cn (smtp25.cstnet.cn [159.226.251.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8816DE2 for ; Wed, 31 May 2023 03:03:16 -0700 (PDT) Received: from localhost.localdomain (unknown [124.16.138.125]) by APP-05 (Coremail) with SMTP id zQCowAAXHFhPG3dkxwyiCA--.5661S2; Wed, 31 May 2023 18:02:55 +0800 (CST) From: Jiasheng Jiang To: lee@kernel.org Cc: linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: [PATCH] mfd: intel-lpss: Add missing check for platform_get_resource Date: Wed, 31 May 2023 18:02:57 +0800 Message-Id: <20230531100257.17769-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: zQCowAAXHFhPG3dkxwyiCA--.5661S2 X-Coremail-Antispam: 1UD129KBjvdXoW7JryxWw48Ar18KrWkCr4fAFb_yoW3uFX_Ga n5Z3WfXrWIkrs5Kw1xtrya9ryFywn2gr4kXayIyFWSyryUJryUWryDuFs8Jw17uas0kFyD Gr1DJr43C3WayjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbc8FF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCY02Avz4vE14v_Gw1l 42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJV WUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1Y6r17MIIYrxkI7VAK I48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r 4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY 6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjfU0NtxUUUUU X-Originating-IP: [124.16.138.125] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,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 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; + info->irq = platform_get_irq(pdev, 0); ret = intel_lpss_probe(&pdev->dev, info); -- 2.25.1