From: tip-bot for Borislav Petkov <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: bp@suse.de, mingo@kernel.org, tony.luck@intel.com, hpa@zytor.com,
tglx@linutronix.de, linux-edac@vger.kernel.org
Subject: [tip:ras/core] RAS/CEC: Fix potential memory leak
Date: Sat, 8 Jun 2019 14:27:31 -0700 [thread overview]
Message-ID: <tip-d0e375e8f26edd2e577e3afa9d952f91037cbd87@git.kernel.org> (raw)
Commit-ID: d0e375e8f26edd2e577e3afa9d952f91037cbd87
Gitweb: https://git.kernel.org/tip/d0e375e8f26edd2e577e3afa9d952f91037cbd87
Author: Borislav Petkov <bp@suse.de>
AuthorDate: Sat, 20 Apr 2019 21:39:24 +0200
Committer: Borislav Petkov <bp@suse.de>
CommitDate: Sat, 8 Jun 2019 17:35:04 +0200
RAS/CEC: Fix potential memory leak
Free the array page if a failure is encountered while creating the
debugfs nodes.
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
---
drivers/ras/cec.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c
index 31868bd99e8d..f57e869dfea2 100644
--- a/drivers/ras/cec.c
+++ b/drivers/ras/cec.c
@@ -504,8 +504,10 @@ void __init cec_init(void)
return;
}
- if (create_debugfs_nodes())
+ if (create_debugfs_nodes()) {
+ free_page((unsigned long)ce_arr.array);
return;
+ }
INIT_DELAYED_WORK(&cec_work, cec_work_fn);
schedule_delayed_work(&cec_work, CEC_DECAY_DEFAULT_INTERVAL);
reply other threads:[~2019-06-08 21:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=tip-d0e375e8f26edd2e577e3afa9d952f91037cbd87@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@suse.de \
--cc=hpa@zytor.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.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).