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 X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30E5CC433ED for ; Fri, 23 Apr 2021 08:16:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E0DCA613AD for ; Fri, 23 Apr 2021 08:16:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241314AbhDWIQy convert rfc822-to-8bit (ORCPT ); Fri, 23 Apr 2021 04:16:54 -0400 Received: from mail-ua1-f43.google.com ([209.85.222.43]:40916 "EHLO mail-ua1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbhDWIQn (ORCPT ); Fri, 23 Apr 2021 04:16:43 -0400 Received: by mail-ua1-f43.google.com with SMTP id 33so14992487uaa.7; Fri, 23 Apr 2021 01:16:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=em5cBkyIOctbiBIb5XOHeNIoZhZ0Au6He4zk5hvtim0=; b=ZE2+dqiahsK5K3oJo/94WYdBSojK6e8rIK4gA+DJBwQKYbLYVcdudeysRoosK3XJkh gdIMNCOIDGHDejRH4j+a3aFsNlledXSrWy2XYS/k5BJDkdRWKjgTNXMspvp9Y2X+4dh7 IkNlRBbnxt0LEnnoUwQAfYXU+yCd+KHpxSmTT2/fICjweVAItq4DDC41AGukNWn5RXHr 6SuLEg396d7g5IZfRk+4GWj95vZXgHdNVyj3z0eSmo42wl98a7RTXbBHXEreZ9MFc1G0 BTCGySMaM5TVAKx/k24E4qNuE26952OxPGz1JPvH+uCrDBIw1FNzsiP+pjLN0bCtPRA/ 834g== X-Gm-Message-State: AOAM5309TCYd7DNf09nz9pHb+ZgTAZ7I+3jUW2jnjdVnZrO8yO6xzjPx SxQyzIAsZHN/afVlEJb/dbG/MMaFKhRJLZA/+ng= X-Google-Smtp-Source: ABdhPJzs7QQ9wDVIOqECoab5U4QfcaGoOvpaRh485U6lD/Rn12Wu8XQlF6Eq19fXg6cwpPDX0gyfdAuxSqblikx+7Ek= X-Received: by 2002:ab0:2c16:: with SMTP id l22mr2051057uar.100.1619165766905; Fri, 23 Apr 2021 01:16:06 -0700 (PDT) MIME-Version: 1.0 References: <20210415073338.22287-1-dinghao.liu@zju.edu.cn> <2fd8490f.73bcd.178fdc55590.Coremail.dinghao.liu@zju.edu.cn> In-Reply-To: <2fd8490f.73bcd.178fdc55590.Coremail.dinghao.liu@zju.edu.cn> From: Geert Uytterhoeven Date: Fri, 23 Apr 2021 10:15:55 +0200 Message-ID: Subject: Re: Re: [PATCH] [v3] clk: renesas: rcar-usb2-clock-sel: Fix error handling in rcar_usb2_clock_sel_probe To: Dinghao Liu Cc: Kangjie Lu , Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Linux-Renesas , linux-clk , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dinghao, On Fri, Apr 23, 2021 at 10:08 AM wrote: > > On Thu, Apr 15, 2021 at 9:33 AM Dinghao Liu wrote: > > > The error handling paths after pm_runtime_get_sync() has no > > > refcount decrement, which leads to refcount leak. > > > > > > Signed-off-by: Dinghao Liu > > > --- > > > > > > Changelog: > > > > > > v2: - Move the position of pm_runtime_enable,_get_sync(). > > > Use devm_clk_register() to simplify error handling. > > > > Thanks for the update! > > > > > --- a/drivers/clk/renesas/rcar-usb2-clock-sel.c > > > +++ b/drivers/clk/renesas/rcar-usb2-clock-sel.c > > > @@ -131,7 +131,6 @@ static int rcar_usb2_clock_sel_remove(struct platform_device *pdev) > > > struct usb2_clock_sel_priv *priv = platform_get_drvdata(pdev); > > > > warning: unused variable ‘priv’ [-Wunused-variable] > > > > Have you compiled this? > > > > This is my carelessness, thanks for pointing out this. When we use > devm_clk_hw_register(), we will not need to unregister priv->hw in > rcar_usb2_clock_sel_remove(). So I think it's okay to remove > platform_get_drvdata() in it to eliminate this warning. > > Do you need a new version of patch to fix this warning? I'll remove that line while applying, so no need to fix and resend. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds