From: Li Zefan <lizefan@huawei.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: fix possible memory leak in dlm_process_recovery_data
Date: Thu, 2 May 2013 11:14:13 +0800 [thread overview]
Message-ID: <5181DA05.5020405@huawei.com> (raw)
In-Reply-To: <51182BCE12D4834EA8164B99A509EABB32CDA65F@szxeml521-mbs.china.huawei.com>
This patch is mangled. Please read Documentation/email-clients.txt and configure
your email client properly, and then re-send the patch.
On 2013/5/1 12:06, Qijiang (Joseph) wrote:
> We create newlock each time in dlm_process_recovery_data, but we don't free it when it is bad, and then it will lead to memory leak.
The leading spaces are not need, and please break into lines within 80 characters.
(or 72 to be more strict)
>
> Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
>
> ---
> fs/ocfs2/dlm/dlmrecovery.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
> index eeac97b..93de2e0 100644
> --- a/fs/ocfs2/dlm/dlmrecovery.c
> +++ b/fs/ocfs2/dlm/dlmrecovery.c
> @@ -1974,6 +1974,12 @@ skip_lvb:
> res->lockname.len, res->lockname.name, ml->node);
> dlm_lockres_set_refmap_bit(dlm, res, ml->node);
> added++;
> + } else {
> + /* should free newlock if it is bad */
> + if (newlock) {
> + dlm_lock_put(newlock);
> + newlock = NULL;
> + }
> }
> spin_unlock(&res->spinlock);
> }
> --
> 1.7.9.7
>
>
>
next prev parent reply other threads:[~2013-05-02 3:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-01 4:06 [Ocfs2-devel] [PATCH] ocfs2: fix possible memory leak in dlm_process_recovery_data Qijiang
2013-05-02 3:14 ` Li Zefan [this message]
2013-05-02 5:00 ` Jeff Liu
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=5181DA05.5020405@huawei.com \
--to=lizefan@huawei.com \
--cc=ocfs2-devel@oss.oracle.com \
/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.