Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3249606rwd; Mon, 22 May 2023 10:42:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6EKTYEYTcd6pY0XxC3quUp2qMEtA3WUri1YW8VjpNGiiPqSJOsDYB4U1gzu9RKH6dIzIl1 X-Received: by 2002:a17:903:234a:b0:1ac:a88a:70b6 with SMTP id c10-20020a170903234a00b001aca88a70b6mr16346366plh.31.1684777346720; Mon, 22 May 2023 10:42:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684777346; cv=none; d=google.com; s=arc-20160816; b=nBOyoMrmbS9D1y8PPDIVjXpHhcAD5WTYDggcUiEhNjHLQa8RVYr6cO/wMQ8vdgbuBU JWLSO0D1+0u7WPhNemr2uh0R5w6bR1giQ+Dq6jUNZUxr6uRz2G5lkaf4wH6XUwr/yk/m iQMz7xb5Le+Fn0yhWFqsOrVWCNVrIy97v3iJxouj8aYObKRBHp/HGy0Tkbzbl/8aCHrH IgPz1DESFiqdUPhJug4R8VuV5A7aiAgIC9tg5r0gxfW+IwLgNBQydBVsm4YN1B73hdNu ox8762u6pLCSEwK7P1j9oRTUvnY5T1ZCTZ26LMKS0h1JqXnnbE3eJ01xCsQBhebc3h9T JGbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=N2xeMMt507hgLYLfEZ8Hr/iAkxhU2Bot31n27SNKL3Q=; b=gm1Y1A1Wyw+z8pUx6PgwPKO4ZNqEKOFhb//kDPsWiP52I8jfrftrejk8qjwScMTKoI 3j18lSfV0K9a+KWzsxczIclsYrUEwq7t71Yjv8qLdb9XjO9KxtqsKI1/lt+hWN/lmtaN 75KAr0RIs4HmrmihekWySxPBCodrbdb+Dngq4GLO0XpAWRSU4QBV/zMHxDT8N2WoYMRp X5Csd93Diz2j2X8onv+LV7lUrCwdmzvzYQoVbVPv657335IyubedEizvAD7zU6HRmXCD 54F/9m1uolFwkhu/ICHYRTZUsAF0ZUbTOv9xevmUh0wS3s2Z/M3oQ9C8vCDlX7u5uDWp g+/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=CbtRPseU; 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 x12-20020a170902ec8c00b001a5abc9d9bcsi502721plg.583.2023.05.22.10.42.09; Mon, 22 May 2023 10:42:26 -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=@wanadoo.fr header.s=t20230301 header.b=CbtRPseU; 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 S229830AbjEVRg4 (ORCPT + 99 others); Mon, 22 May 2023 13:36:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbjEVRgy (ORCPT ); Mon, 22 May 2023 13:36:54 -0400 Received: from smtp.smtpout.orange.fr (smtp-26.smtpout.orange.fr [80.12.242.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5D16FA for ; Mon, 22 May 2023 10:36:51 -0700 (PDT) Received: from [192.168.1.18] ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 19Siq1SEJ0h9k19Siqvch6; Mon, 22 May 2023 19:36:50 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1684777010; bh=N2xeMMt507hgLYLfEZ8Hr/iAkxhU2Bot31n27SNKL3Q=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=CbtRPseUNMnLVW7YNBpro4cTwHUAf10/+3NYlms9nzDozd9I4w3nY0HrMVDunCe50 n7ytgccw3z8ursUZ4gnbmIlaau/el9jLxWoMa3JAdrNHRqGGrLM2RV1vCLwJQP5G7N uIhwHemIzNXHY1L95+fQuiIm0rpXrbfG01s6cVKc/UUF/OiBOZzDXl414J5LadVLm5 wbQZ/hsdQlJjpR3QyUh3X6HFdg4G52NVaG5wb278n0+ZoEIsmFgl2Z1CJiHLC4JOOq Ka7mqKyL22nKz3QJnnKU3Usiz4vBPfB20Nmtpxn3gxbIFh3UaCCb2Xy362H52FAgzh RQbUnvMieiQfA== X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 22 May 2023 19:36:50 +0200 X-ME-IP: 86.243.2.178 Message-ID: Date: Mon, 22 May 2023 19:36:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v16 1/1] clk: npcm8xx: add clock controller Content-Language: fr To: Tomer Maimon 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 References: <20230521143202.155399-1-tmaimon77@gmail.com> <20230521143202.155399-2-tmaimon77@gmail.com> <0e72c35f-5d9d-45a7-5f85-3971b8029106@wanadoo.fr> From: Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 Le 22/05/2023 à 14:56, Tomer Maimon a écrit : > 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 = {}; >>> + int ret; >>> + >>> + pll = 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/20220621131424.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) CJ