Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3344912rwd; Mon, 29 May 2023 09:04:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6J88yQwINW/shrnNptMXaRH3OJ3YJYXW70Alb6LKVc1E8Yip9QhxiqcOr+E3n8LQ4dJ91e X-Received: by 2002:a17:903:22c2:b0:1b0:5304:5b4e with SMTP id y2-20020a17090322c200b001b053045b4emr731063plg.43.1685376249831; Mon, 29 May 2023 09:04:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685376249; cv=none; d=google.com; s=arc-20160816; b=PMkrTuf9whXza0Q338oOmDANDwAx5kMoHE6CDtCecRNRXrMxsTkXHASRlEdROLWp/P IEwgxsql1sezJMelERS6rbw1rwj/hRETNQKH0AR24yy0xd4g1ZgvjaOIRvqjlrhnGlZg pnZYdQDoLCU4wZifCzZCPb32gOuIau9DilxORlrgVhmakRe1Pfz9fRTJcrnC7XNxQG6u 76V5g9PG6YItZJN9tfDFJpQQk9vQnrdRUrHcLuL0HFp7zmiRBz+vlWPm78fYowB+Gk1U 9TThA7Tau7JlsAuuvtZ8PTJ/YPV0s+dJGoS15ArmJi061GCRjsI3iuqtC2QWYKySVrBE bAiw== 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 :dkim-signature; bh=dGEKNlVjba3Uxjbme8b9RXxIe58f3YvDlezq/+8zxTI=; b=ewKm5Q/bMZZf8L670T0ipEgfjp93nkxGmoMF1BYEfNqwV6dvTebSYbCK5HOSozGkDu BM4zkiTBNZkBk5agnO9o1zImPxFLRGLiV972IlieR3cJBKkt65rum6LyxOzAb3RhpFI+ xlFlLV8ZbGXLvSpqlY7IzfXMwOboHzimL0/rVA8upfvTYgbQD8lRgUWDnSWklwjS2MO0 ua5K9VQpYPTQ/9cVHiZjTw5paw9kno4ukdsraGxUyad7eB8F0OM0Z4M3tRmMXMN2ENjv Nq56m3iVbUKA0sQKhrhZ+uJAdiGXvBCeBLCwPGEHIYngIOSZ2wzH5ufls1+hUoyrqagI ELDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Mjj5Ugct; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b21-20020a170902b61500b001b025685062si4377894pls.574.2023.05.29.09.03.56; Mon, 29 May 2023 09:04:09 -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=@gmail.com header.s=20221208 header.b=Mjj5Ugct; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230095AbjE2Pwt (ORCPT + 99 others); Mon, 29 May 2023 11:52:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230098AbjE2Pwr (ORCPT ); Mon, 29 May 2023 11:52:47 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE192D2; Mon, 29 May 2023 08:52:45 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2af1822b710so35781341fa.1; Mon, 29 May 2023 08:52:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685375564; x=1687967564; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=dGEKNlVjba3Uxjbme8b9RXxIe58f3YvDlezq/+8zxTI=; b=Mjj5UgctfezMCHltzHW+A8T5x5/3dFb2dzNasfCyGbtOikmZvng/0XBFxq+uXYE/FY t6l3BHE+27xIy++ICtp63addI+J79hwzn9bwR19674sk57FXhmiKyPx6OWLuTTOaij4Z X5lumtOqj/JWTUjEujNKKgVE4eoiLWeJiafazpmY/LiF/Vxcelg6tRJZOhcpOptzwS2s KizfpfxMqxskhm2Q8DevdKApUT0fMSws9sWE162eWkKflZT0XPRKSMtAC8F6NU2Pxioy tPhZJEVXYtGGE+qRPRtJ2he+drqgMzbohVXSCnJD3svkS9XPXb+E95Hi1t4Ch6W2g4D8 aFog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685375564; x=1687967564; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dGEKNlVjba3Uxjbme8b9RXxIe58f3YvDlezq/+8zxTI=; b=cSA8HodNSkqlS1yXBXd2PLvZSKyTMfk7UnZ8oaT7jF/Oskn1rmSbbTrCOyphIr/XfN xgCNa/nmJZ2vlaxac2FNeQKqIUdyWRXEg4ei+DBrhTz9Reiftdr0ryd+8z0AQZe3ZIIF SEQI2+n7BiEIm/H/Yu70tc03E1eUH2pAA+OBVev43+9ZYLfDV42KEtIjzvFh5KfBECEj vcevGGn8YUyTX8hdgPQV1tFS8OaizB9RjfrGiMGAPnsywPYr3fKnNS4wt9IVa6QbsvQd vTiSdQ3hs13jIQYXxtmyxpg0ZFPIWC9m8HmMJ+f0A2J6IMeZE6Q0Pp5gU7LiayMzs8HQ 0/lA== X-Gm-Message-State: AC+VfDyn1P/yfzVB3w4+EkVBSnVS9rNQUIE8ySKUeoXKZVqTvrIr94f0 +67dKTZL9ih/pl60vhdKNwv7btrfuFr6gEzZd5s= X-Received: by 2002:a2e:84c1:0:b0:2a7:748c:1eef with SMTP id q1-20020a2e84c1000000b002a7748c1eefmr4039767ljh.38.1685375563857; Mon, 29 May 2023 08:52:43 -0700 (PDT) MIME-Version: 1.0 References: <20230521143202.155399-1-tmaimon77@gmail.com> <20230521143202.155399-2-tmaimon77@gmail.com> <0e72c35f-5d9d-45a7-5f85-3971b8029106@wanadoo.fr> In-Reply-To: From: Tomer Maimon Date: Mon, 29 May 2023 18:52:32 +0300 Message-ID: Subject: Re: [PATCH v16 1/1] clk: npcm8xx: add clock controller To: Christophe JAILLET Cc: mturquette@baylibre.com, sboyd@kernel.org, avifishman70@gmail.com, tali.perry1@gmail.com, joel@jms.id.au, venture@google.com, yuenn@google.com, benjaminfair@google.com, openbmc@lists.ozlabs.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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 Mon, 22 May 2023 at 20:36, Christophe JAILLET wrote: > > Le 22/05/2023 =C3=A0 14:56, Tomer Maimon a =C3=A9crit : > > Hi Christophe, > > > > Thanks for your comments > > > > [...] > > >>> +static struct clk_hw * > >>> +npcm8xx_clk_register_pll(struct device *dev, void __iomem *pllcon, > >>> + const char *name, const struct clk_parent_data= *parent, > >>> + unsigned long flags) > >>> +{ > >>> + struct npcm8xx_clk_pll *pll; > >>> + struct clk_init_data init =3D {}; > >>> + int ret; > >>> + > >>> + pll =3D kzalloc(sizeof(*pll), GFP_KERNEL); > >> > >> Everything looks devm_()'ed in this driver, except this kzalloc. > >> Except the one below, there is no kfree to free this memory, and no > >> .remove() function. > > Also clk_hw_register_divider_parent_data doesn't use devm_ > > about free the pll, we use it, return at the end of the function. > > about adding remove, we had a dissection about it in V4, since the > > clock is a service driver it shouldn't be removed. > > https://patchwork.kernel.org/project/linux-watchdog/patch/2022062113142= 4.162355-7-tmaimon77@gmail.com/ > > LoL. > At least, I'm consistent :). > > Just to make it clear, what I mean about kfree() is not to add one here, > but either: > - to use devm_kzalloc() here, to avoid a leak, should loading the > driver fails OR > - have some kfree() where needed (at least in the error handling > path of the probe, if the remove function makes no point) O.K. Thanks for your clarification. > > CJ Best regards, Tomer