Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp264259imi; Thu, 21 Jul 2022 21:21:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s5g0sr+4cHIPAgus0moZNcHFXyLcCj8uVjFQ8DfDh7S6la6WdVOfYCYsz/tdyCa7jvSI8d X-Received: by 2002:a62:3850:0:b0:52b:6daa:148e with SMTP id f77-20020a623850000000b0052b6daa148emr1511282pfa.15.1658463705897; Thu, 21 Jul 2022 21:21:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658463705; cv=none; d=google.com; s=arc-20160816; b=BGfsheQPeq4SKcmE0OT81EstV5v2sRKLKI1gZ0JxMH1OFQhwcb2UQcfX2JNhXOjx5E MBnWbhK9vT1LGp/T8zLZGxrx7g+N8IITdIGOQA44LaRUC3O4GbWgVoNX0OgRrbEA80kS mXYJgjgJtSOWn/2ZNZkHH+Y91+aqhbSfmpculP23F0y/jR8zLnCM29bcQoQ3hRyv+7jq CkFaBhK7G38HSeuIgLQOfAM3cSguxv8xcwMNbED8u19mMvYKZ/sZAqc9n47RFWfSNUpk obHhSSXf3hPIAtM5nUBJljO+CpEwIwu+yadT9xg2Edngwc8fdk2Bwwe4pubCG6/EZBdN 6DFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from:dkim-signature; bh=ZNFDAh6e57180WKrcbRrtAhDuN2uzlkx0xV24F2OWns=; b=ubt4YLZw62pmfoj9Ef8HA4dZLFotoe5YBDvA6UFJJh5sYTuBNnER/Ve6eI67L6mU4o Aj5wlJ3YBLGVSUHLsAIqeP4eAsNKUiw31LF/gf/IOnW474nnHJW3oUFxvdBe/o4DH+7g jP90T+WH1xj1Mg1WJGwyOMdJBGXZ0dWsixdKzDhT1RBJiQVCsD46cdq7YNfAirYDTHZm a2lRRmLIv5NO3O71wLimFx6iHgWfwixA1e6nGlE5NJLrEhaWclV5Sp/S3mV8YzcPS0Ky AgmQk4uGEX7SHrmQvx2pezXtGH1OKjdiPZjbx4WPqhZTVYUpSjpw/5SVzT+iEXJiWHiU kEXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=EMsanHh6; 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=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b2-20020a63cf42000000b00408c2ac7412si4661209pgj.660.2022.07.21.21.21.31; Thu, 21 Jul 2022 21:21:45 -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=@163.com header.s=s110527 header.b=EMsanHh6; 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=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231700AbiGVEOT (ORCPT + 99 others); Fri, 22 Jul 2022 00:14:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234301AbiGVEOQ (ORCPT ); Fri, 22 Jul 2022 00:14:16 -0400 Received: from m12-15.163.com (m12-15.163.com [220.181.12.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CDE0F89AA0 for ; Thu, 21 Jul 2022 21:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=ZNFDAh6e57180WKrcb RrtAhDuN2uzlkx0xV24F2OWns=; b=EMsanHh6bg4h0tgDvyXvAJw4tIqKly97lJ b8YLRnrxH+tWV8FHp6hnDHScAXZxYQX6TBxEEBwW1xQ+vi7uxuD1vky7P6l6Kj+n ajdTpOIkjebgjyJi4IcIz90/lMgFvIDQDze8OkF9lvYZ9Vqi2ebZi+jHgqL76dhf Idf+5u1xg= Received: from localhost.localdomain (unknown [202.112.113.212]) by smtp11 (Coremail) with SMTP id D8CowACniFX5I9piCOM3AQ--.17251S4; Fri, 22 Jul 2022 12:14:01 +0800 (CST) From: Yuanjun Gong To: Yuanjun Gong , Santosh Shilimkar , linux-kernel@vger.kernel.org Subject: [PATCH 1/1] drivers/clk/keystone: avoid a memory leak Date: Fri, 22 Jul 2022 12:13:43 +0800 Message-Id: <20220722041343.39492-1-ruc_gongyuanjun@163.com> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: D8CowACniFX5I9piCOM3AQ--.17251S4 X-Coremail-Antispam: 1Uf129KBjvdXoW7GryrCr1UtFyfXr43GF1DAwb_yoWxCFb_Wa yrZr4xWas5Cr1qvFW8uF1ruryFvr15ur1fZ3Wagay3WFyUZr1UCr4DZrZ3Zw1UXrWIyry3 Kr47JrW3Cwn5AjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRRRwZ5UUUUU== X-Originating-IP: [202.112.113.212] X-CM-SenderInfo: 5uxfsw5rqj53pdqm30i6rwjhhfrp/xtbBSQlG5VaEEO1zrwAAsQ X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 In ti_syscon_gate_clk_register, priv is allocated by devm_kzalloc. On the error path, it should be freed before return. Signed-off-by: Yuanjun Gong --- drivers/clk/keystone/syscon-clk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/keystone/syscon-clk.c b/drivers/clk/keystone/syscon-clk.c index 19198325b909..d8919bdafe34 100644 --- a/drivers/clk/keystone/syscon-clk.c +++ b/drivers/clk/keystone/syscon-clk.c @@ -84,6 +84,7 @@ static struct clk_hw ret = devm_clk_hw_register(dev, &priv->hw); if (ret) + devm_kfree(dev, priv); return ERR_PTR(ret); return &priv->hw; -- 2.17.1