projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d1eef1c
)
pstore/ram: Fix error-path memory leak in persistent_ram_new() callers
author
Kees Cook
<keescook@chromium.org>
Mon, 30 Dec 2019 19:48:10 +0000
(11:48 -0800)
committer
Kees Cook
<keescook@chromium.org>
Thu, 2 Jan 2020 20:30:39 +0000
(12:30 -0800)
For callers that allocated a label for persistent_ram_new(), if the call
fails, they must clean up the allocation.
Suggested-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Fixes:
1227daa43bce
("pstore/ram: Clarify resource reservation labels")
Cc: stable@vger.kernel.org
Link:
https://lore.kernel.org/lkml/20191211191353.14385-1-navid.emamdoost@gmail.com
Signed-off-by: Kees Cook <keescook@chromium.org>
fs/pstore/ram.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/pstore/ram.c
b/fs/pstore/ram.c
index 8caff834f002668eb79d84d2adf8c108dbc2c640..f753f3b6f88dde03ed6f32f2a7d737cf90570afd 100644
(file)
--- a/
fs/pstore/ram.c
+++ b/
fs/pstore/ram.c
@@
-577,6
+577,7
@@
static int ramoops_init_przs(const char *name,
dev_err(dev, "failed to request %s mem region (0x%zx@0x%llx): %d\n",
name, record_size,
(unsigned long long)*paddr, err);
+ kfree(label);
while (i > 0) {
i--;
@@
-622,6
+623,7
@@
static int ramoops_init_prz(const char *name,
dev_err(dev, "failed to request %s mem region (0x%zx@0x%llx): %d\n",
name, sz, (unsigned long long)*paddr, err);
+ kfree(label);
return err;
}