public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] mmc: debugfs: fix memory leak for mmc_ext_csd_open
@ 2015-09-22  1:18 Shawn Lin
  2015-09-22  1:19 ` [PATCH 2/3] mmc: debugfs: implement ios show for SDR12 and SDR25 Shawn Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Shawn Lin @ 2015-09-22  1:18 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc, linux-kernel, Shawn Lin

buf allocated isn't been freed before return, so we fix it.

Fixes: 736bb6bb01a ("mmc: Add Extended CSD register to debugfs")
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

 drivers/mmc/core/debugfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
index e914210..b2ab936 100644
--- a/drivers/mmc/core/debugfs.c
+++ b/drivers/mmc/core/debugfs.c
@@ -304,6 +304,7 @@ static int mmc_ext_csd_open(struct inode *inode, struct file *filp)
 
 	filp->private_data = buf;
 	kfree(ext_csd);
+	kfree(buf);
 	return 0;
 
 out_free:
-- 
2.3.7



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-09-23 21:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-22  1:18 [PATCH 1/3] mmc: debugfs: fix memory leak for mmc_ext_csd_open Shawn Lin
2015-09-22  1:19 ` [PATCH 2/3] mmc: debugfs: implement ios show for SDR12 and SDR25 Shawn Lin
2015-09-23 19:33   ` Ulf Hansson
2015-09-22  1:20 ` [PATCH 3/3] mmc: debugfs: implement ios show for driver type Shawn Lin
2015-09-23 21:42   ` Ulf Hansson
     [not found] ` <CAK7Sx+gO2=jhQ-DpNqm4o+JUqKv+38a1C9CtZ4sZrUQ5XGJqHQ@mail.gmail.com>
2015-09-22  1:37   ` [PATCH 1/3] mmc: debugfs: fix memory leak for mmc_ext_csd_open Shawn Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox