All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shawn Lin <shawn.lin@rock-chips.com>
To: trick wong <trickwong@gmail.com>
Cc: shawn.lin@rock-chips.com, Ulf Hansson <ulf.hansson@linaro.org>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] mmc: debugfs: fix memory leak for mmc_ext_csd_open
Date: Tue, 22 Sep 2015 09:37:01 +0800	[thread overview]
Message-ID: <5600B0BD.704@rock-chips.com> (raw)
In-Reply-To: <CAK7Sx+gO2=jhQ-DpNqm4o+JUqKv+38a1C9CtZ4sZrUQ5XGJqHQ@mail.gmail.com>

On 2015/9/22 9:29, trick wong wrote:
> In the correct path,this buf will used later.why freed?
>

right.
sorry for this noise, withdraw this patch[1/3].

> 2015-09-22 9:18 GMT+08:00 Shawn Lin <shawn.lin@rock-chips.com
> <mailto:shawn.lin@rock-chips.com>>:
>
>     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
>     <mailto: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
>
>
>     --
>     To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
>     the body of a message to majordomo@vger.kernel.org
>     <mailto:majordomo@vger.kernel.org>
>     More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>


-- 
Best Regards
Shawn Lin


      parent reply	other threads:[~2015-09-22  1:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Shawn Lin [this message]

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=5600B0BD.704@rock-chips.com \
    --to=shawn.lin@rock-chips.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=trickwong@gmail.com \
    --cc=ulf.hansson@linaro.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.