All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
To: <linux-clk@vger.kernel.org>
Cc: <sboyd@kernel.org>, <mturquette@baylibre.com>,
	<michal.simek@xilinx.com>, <git-dev@xilinx.com>,
	Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Subject: [PATCH 2/3] clk: zynqmp: Fix a memory leak
Date: Wed, 18 Aug 2021 12:29:28 +0530	[thread overview]
Message-ID: <20210818065929.12835-3-shubhrajyoti.datta@xilinx.com> (raw)
In-Reply-To: <20210818065929.12835-1-shubhrajyoti.datta@xilinx.com>

Fix a memory leak of mux.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
---
 drivers/clk/zynqmp/clk-mux-zynqmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/zynqmp/clk-mux-zynqmp.c b/drivers/clk/zynqmp/clk-mux-zynqmp.c
index 157d4a960bf4..17afce594f28 100644
--- a/drivers/clk/zynqmp/clk-mux-zynqmp.c
+++ b/drivers/clk/zynqmp/clk-mux-zynqmp.c
@@ -159,7 +159,7 @@ struct clk_hw *zynqmp_clk_register_mux(const char *name, u32 clk_id,
 	hw = &mux->hw;
 	ret = clk_hw_register(NULL, hw);
 	if (ret) {
-		kfree(hw);
+		kfree(mux);
 		hw = ERR_PTR(ret);
 	}
 
-- 
2.17.1


  parent reply	other threads:[~2021-08-18  6:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18  6:59 [PATCH 0/3] clk: zynqmp: Misc fixes Shubhrajyoti Datta
2021-08-18  6:59 ` [PATCH 1/3] clk: zynqmp: Check the return type Shubhrajyoti Datta
2021-08-29  4:26   ` Stephen Boyd
2021-08-29  4:26   ` Stephen Boyd
2021-08-18  6:59 ` Shubhrajyoti Datta [this message]
2021-08-29  4:26   ` [PATCH 2/3] clk: zynqmp: Fix a memory leak Stephen Boyd
2021-08-18  6:59 ` [PATCH 3/3] clk: zynqmp: Fix stack-out-of-bounds in strncpy` Shubhrajyoti Datta
2021-08-29  4:25   ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210818065929.12835-3-shubhrajyoti.datta@xilinx.com \
    --to=shubhrajyoti.datta@xilinx.com \
    --cc=git-dev@xilinx.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.