Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp864481iog; Wed, 29 Jun 2022 11:44:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uA7lfyx/MM7/FWk22XkUCE6E30BTx/lGNmcfM9KiV7+ADcg8AVM+uNEUEfVfeiwY6yqLil X-Received: by 2002:a17:903:44b:b0:16a:1aba:9f80 with SMTP id iw11-20020a170903044b00b0016a1aba9f80mr11667676plb.56.1656528296798; Wed, 29 Jun 2022 11:44:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656528296; cv=none; d=google.com; s=arc-20160816; b=HdmUM1kiFBXUhFbl9+Dr3t2cedw6tEVJPmqkeQmPEPn+Rfc+0DxV1ToIsTEmSoC7Fj 8iNV8IFm+9bSdff/6CyZnw0+cWjjm+rB8nMSDJyQ7X4shp5RVEF02SbV/Cz1R09FUBcl V4gWGs2rdBdukDYUV2P1rbJkmHqjR291tc7HwYMD33JnMRms48pkK4hZx4nMQ6rXY964 yduGeQC3FX4ComBpnH7TuBusu1A1+MhAKN6p2eEj4AghfqZ3cvqCWF8Pgo8k912zMjh1 0IJIKTW9MPW+nBy9/NtX1JcUTsJdVJEbKiCxesLkEiV4VG6PTAivIFInfBol3HbyjmoY S1Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=NClsspyThTYczjmvQ/Mf4tKpKpJ5YtolRVPOGy72ZEA=; b=wZ6Zc4Zbi1jJoJWdfS4wYm3KF9QjCTDbv1mMNn3l4hhxo3EGcz6ae8RDcQv3sW+fLN Uc/hjiq8KKUI3bzgS39IqgC2wdDT24fXYVd16HE15Rt8WBf4gDjfbynODFPNh4AL3+B7 1A73gzveT0PjMvrHt+np8LfqoE0KrF1HNxAJjyJGaEyoGPQ0jL/d++zua++em2CaN8OK PIxsRinuplrO9wZo7sgYqy1HLxN5VI9JL+I+ODXbfsLJVaP5p2C2gp0GufxXoI7khfkO udOprJryDhWA+bg5Dvjyucr6aV0IJvBBH6ERPtbf5zu4y1s7/GUfmjqtmP5mHgG3z9EJ yMEg== 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 k10-20020a635a4a000000b0040d3fd7ddcesi23749068pgm.370.2022.06.29.11.44.43; Wed, 29 Jun 2022 11:44:56 -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 S230347AbiF2SUj convert rfc822-to-8bit (ORCPT + 99 others); Wed, 29 Jun 2022 14:20:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230124AbiF2SUh (ORCPT ); Wed, 29 Jun 2022 14:20:37 -0400 Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E8D0167ED; Wed, 29 Jun 2022 11:20:36 -0700 (PDT) Received: by mail-yb1-f179.google.com with SMTP id p7so28009776ybm.7; Wed, 29 Jun 2022 11:20:36 -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:content-transfer-encoding; bh=Crk8yfaClehfBEoMwUZukif4aHshjHYVzAHB+xwP0FE=; b=HZZG/PtdhoucGRkNyBoYieT+4UYmKgU1bwe86GlHv47yzpSU0PO3JDg6DkkF0ENetV Ablde+BXHcTzoKzbTiUj7J0sv6E6hsn6w+01XCGwlDKzm32l7CrK/szKqaLG3FEO4bXw 1aBhqEOt2fWYeuicC7ShhPVnrtxA6yP2G5JbX2wmGyOCoq54dUO6Z/ogvCMBFeq3E+11 QsgLlXAgc/gVpz/SA6qYZLgAlkvFX2u6k5f0EXjU40rW3u1xSwXCyXshiUiEkga6HJM3 4uIcW5ROKHr5GlAASEpiGxkUBIdrH+9ppLWShSYelzxlIhFGuf7idMqxQhBeJH4gRTzL uVdw== X-Gm-Message-State: AJIora+1bCrPAVm61jVs84jLgufPpFszgmpVh0+tMt4ajrYFP3V61JrN sBYJuNrz4wX38YG+IPlxRulZrX7sQ+75lwShnSSV58Xh X-Received: by 2002:a25:664f:0:b0:66c:d0f4:36cc with SMTP id z15-20020a25664f000000b0066cd0f436ccmr4697176ybm.482.1656526835822; Wed, 29 Jun 2022 11:20:35 -0700 (PDT) MIME-Version: 1.0 References: <20220623132127.1248462-1-15815827059@163.com> <18367cc4.16aa.1819382c273.Coremail.15815827059@163.com> In-Reply-To: <18367cc4.16aa.1819382c273.Coremail.15815827059@163.com> From: "Rafael J. Wysocki" Date: Wed, 29 Jun 2022 20:20:24 +0200 Message-ID: Subject: Re: 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" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,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 Fri, Jun 24, 2022 at 4:35 AM huhai <15815827059@163.com> wrote: > > > At 2022-06-23 21:25:55, "Rafael J. Wysocki" wrote: > >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? > > platform_device_register_simple() never returns NULL as it declared bellowing, > so use IS_ERR() to validate the return value should be enough. > > /** > * platform_device_register_simple - add a platform-level device and its resources > * ... > * Returns &struct platform_device pointer on success, or ERR_PTR() on error. > */ Fair enough. Applied as 5.20 material, thanks!