From: Tycho Andersen <tycho@tycho.ws>
To: Christine Caulfield <ccaulfie@redhat.com>,
David Teigland <teigland@redhat.com>
Cc: cluster-devel@redhat.com, linux-kernel@vger.kernel.org,
Tycho Andersen <tycho@tycho.ws>
Subject: [PATCH 1/3] dlm: fix invalid free
Date: Fri, 2 Nov 2018 14:18:20 -0600 [thread overview]
Message-ID: <20181102201822.12518-2-tycho@tycho.ws> (raw)
In-Reply-To: <20181102201822.12518-1-tycho@tycho.ws>
dlm_config_nodes() does not allocate nodes on failure, so we should not
free() nodes when it fails.
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
---
fs/dlm/member.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/dlm/member.c b/fs/dlm/member.c
index 3fda3832cf6a..cad6d85911a8 100644
--- a/fs/dlm/member.c
+++ b/fs/dlm/member.c
@@ -680,7 +680,7 @@ int dlm_ls_start(struct dlm_ls *ls)
error = dlm_config_nodes(ls->ls_name, &nodes, &count);
if (error < 0)
- goto fail;
+ goto fail_rv;
spin_lock(&ls->ls_recover_lock);
@@ -712,8 +712,9 @@ int dlm_ls_start(struct dlm_ls *ls)
return 0;
fail:
- kfree(rv);
kfree(nodes);
+ fail_rv:
+ kfree(rv);
return error;
}
--
2.17.1
next prev parent reply other threads:[~2018-11-02 20:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-02 20:18 [PATCH 0/3] dlm: fix various incorrect behaviors Tycho Andersen
2018-11-02 20:18 ` Tycho Andersen [this message]
2018-11-02 20:18 ` [PATCH 2/3] dlm: don't allow zero length names Tycho Andersen
2018-11-02 20:18 ` [PATCH 3/3] dlm: don't leak kernel pointer to userspace Tycho Andersen
2018-11-07 22:20 ` [PATCH 0/3] dlm: fix various incorrect behaviors David Teigland
2018-11-09 15:15 ` Tycho Andersen
2018-11-15 18:24 ` Kees Cook
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=20181102201822.12518-2-tycho@tycho.ws \
--to=tycho@tycho.ws \
--cc=ccaulfie@redhat.com \
--cc=cluster-devel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=teigland@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).