Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5895706iog; Thu, 23 Jun 2022 07:26:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sETfVMkalVbL578YyrO8CVNt926L1iYiGsR/HNtBC6Hj3TxY9ap4MbVLOl8XBwbpnl+ooI X-Received: by 2002:a05:6402:329a:b0:435:8935:e95d with SMTP id f26-20020a056402329a00b004358935e95dmr11158431eda.257.1655994388725; Thu, 23 Jun 2022 07:26:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655994388; cv=none; d=google.com; s=arc-20160816; b=zlvYKUTpHXUeNbAJhpH1M5T82VxgMJAIUytgLWqPyYmk9TVRRP6ToZsPiOOm8aAa1u NQXEpU3dam7o5Mim1e0gWLz4FMwwdvTDk72z5aLIj39DdfFBKqgbwOebfLyxnOebplhY 6OXH769pEprkYYBrdot+xUSfwmlL1SmlS7i5O49edvhQTvqnT/eOBYbveDTl37qb/iSX 9MUBK6VL7HJlsAf1/7eOpGQj+bCMkO100l/B+b4mEQgFrMbd+DxyPbB0lQveFr+SDRKp W6f4Rwi1G09nTpZ9EW+Y9O1BvPha2bsSHMvD8GZAIiaBUyY9+V/evg6H7VSm6cCE3dOg /xiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=/VSbXb30dR2Lsb/63hP9yztOqR+GVnXbxsPEVXZX2P8=; b=F9iYAMaa+09oDgizESM7bBo1DquSD+oKEtEz3RmDmHELFUUQCMh7f4r48FLEZbBS0w WSHG8uEeSo7KWHe77ABSolkKA/3dSV6esKO53V1cxz0ebPJHWTVWrAvWEdVL2KCAODZ/ U3NQBh1Gt6F6hNbcIST9iXG8A9warsJFG2Use59x857xtYdYhJ2apOjrl0DnqJKPJyb8 XbLmDtASaqKo17GN/I/TanB/e7lULNP+M5ktzXy0G8YXJhJVxjGrxL8M9TC10OgGC5NJ vkgkHgMYFcCfXq7IqPaNm7s6wmkppVoEEIVXA76RHRN0O6v1KZ+/vQoRXz89x7h6+4wG wiOw== 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; 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 b4-20020a0564021f0400b004355cae52e0si9450897edb.218.2022.06.23.07.26.02; Thu, 23 Jun 2022 07:26:28 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229970AbiFWN0L (ORCPT + 99 others); Thu, 23 Jun 2022 09:26:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230230AbiFWN0H (ORCPT ); Thu, 23 Jun 2022 09:26:07 -0400 Received: from mail-yw1-f181.google.com (mail-yw1-f181.google.com [209.85.128.181]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EAE849CA5; Thu, 23 Jun 2022 06:26:07 -0700 (PDT) Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-317741c86fdso192022367b3.2; Thu, 23 Jun 2022 06:26:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/VSbXb30dR2Lsb/63hP9yztOqR+GVnXbxsPEVXZX2P8=; b=jVMs100MVogt/YYqOiULAATiSYeusG2/qfrBiT7Dmgv5CHxWdGPLoG9xiaT7DZFYQc fQwXG7zS19k5LNgWVyOY3MxF9tErAn07JrqwNkLl7VYQ6XnnBAXJjw4gPx/JGzTFiBn2 9OYOEQqZ37dQt/dJaAJEhZQN2+m+wIFQQVlQJvVo1zKVsPnnGnPnUQDkeb5mt5D/L6cJ tgfOWsw77zGtRt+n2VchR4T4JvTkZPgEvMO3scNdLWdjszj4SKyhnI4qjXvvZheSiF0Z R6lzH6wPBZ5tKT+Lj7B1+sTlkzRx2EEWz0zPzGswSTQ9TbN/sONYRkPIs6XpUH1215nw i2bg== X-Gm-Message-State: AJIora/t+Y0NHiL7jij4KBqhfMzPJvfh7hCpaDdgXVnvlJOO/LpGhS4J ROLM/uwgdYzFGAtuj5WRMouaOTEJ6zsFtgeFgyw= X-Received: by 2002:a81:68d7:0:b0:318:11df:a40d with SMTP id d206-20020a8168d7000000b0031811dfa40dmr10924585ywc.196.1655990766614; Thu, 23 Jun 2022 06:26:06 -0700 (PDT) MIME-Version: 1.0 References: <20220623132127.1248462-1-15815827059@163.com> In-Reply-To: <20220623132127.1248462-1-15815827059@163.com> From: "Rafael J. Wysocki" Date: Thu, 23 Jun 2022 15:25:55 +0200 Message-ID: Subject: Re: [PATCH] ACPI: LPSS: Fix missing check in register_device_clock To: huhai <15815827059@163.com> Cc: "Rafael J. Wysocki" , Len Brown , ACPI Devel Maling List , Linux Kernel Mailing List , huhai Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 Thu, Jun 23, 2022 at 3:21 PM huhai <15815827059@163.com> wrote: > > From: huhai > > register_device_clock() misses a check for platform_device_register_simple(). > Add a check to fix it. > > Signed-off-by: huhai > --- > drivers/acpi/acpi_lpss.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c > index fbe0756259c5..c4d4d21391d7 100644 > --- a/drivers/acpi/acpi_lpss.c > +++ b/drivers/acpi/acpi_lpss.c > @@ -422,6 +422,9 @@ static int register_device_clock(struct acpi_device *adev, > if (!lpss_clk_dev) > lpt_register_clock_device(); > > + if (IS_ERR(lpss_clk_dev)) > + return PTR_ERR(lpss_clk_dev); > + Why not use IS_ERR_OR_NULL() instead? > clk_data = platform_get_drvdata(lpss_clk_dev); > if (!clk_data) > return -ENODEV; > -- > 2.27.0 > > > No virus found > Checked by Hillstone Network AntiVirus >