projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
85b67ff
)
ext4: Remove unnecessary release when memory allocation failed in ext4_mb_init_cache
author
Kemeng Shi
<shikemeng@huaweicloud.com>
Fri, 3 Mar 2023 17:21:09 +0000
(
01:21
+0800)
committer
Theodore Ts'o
<tytso@mit.edu>
Thu, 6 Apr 2023 05:13:11 +0000
(
01:13
-0400)
If we alloc array of buffer_head failed, there is no resource need to be
freed and we can simpily return error.
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Link:
https://lore.kernel.org/r/20230303172120.3800725-10-shikemeng@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/mballoc.c
patch
|
blob
|
history
diff --git
a/fs/ext4/mballoc.c
b/fs/ext4/mballoc.c
index d141e5c2e44c7e92d7d7ea545f7ba86a19cab26d..17cfe6c2b582c2e08dd332512d39e2263559acba 100644
(file)
--- a/
fs/ext4/mballoc.c
+++ b/
fs/ext4/mballoc.c
@@
-1168,10
+1168,8
@@
static int ext4_mb_init_cache(struct page *page, char *incore, gfp_t gfp)
if (groups_per_page > 1) {
i = sizeof(struct buffer_head *) * groups_per_page;
bh = kzalloc(i, gfp);
- if (bh == NULL) {
- err = -ENOMEM;
- goto out;
- }
+ if (bh == NULL)
+ return -ENOMEM;
} else
bh = &bhs;