Skip to contentSkip to conversation

jffs2: remove unneeded kfree.

PATCH In review fangwei 2 participants 3 messages Apr 7, 2015 – Jul 7, 2015

Subsystems (2)
lore
Share & tools
lore

fangwei

author
#0 lore raw

PATCH 1/1 jffs2: remove unneeded kfree.

c->oobbuf hasn't been kmalloced in jffs2_dataflash_setup, so there is no need to free it.

---
 fs/jffs2/wbuf.c | 1 -
 1 file changed, 1 deletion(-)
fs/jffs2/wbuf.c +0 -1
index 09ed551..63f31c0 100644
@@ -1274,7 +1274,6 @@ int jffs2_dataflash_setup(struct jffs2_sb_info *c) {
 #ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
        c->wbuf_verify = kmalloc(c->wbuf_pagesize, GFP_KERNEL);
        if (!c->wbuf_verify) {
-               kfree(c->oobbuf);
                kfree(c->wbuf);
                return -ENOMEM;
        }
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 13 lines · fangwei

c->oobbuf hasn't been kmalloced in jffs2_dataflash_setup, so there is no need to free it.

---
 fs/jffs2/wbuf.c | 1 -
 1 file changed, 1 deletion(-)
fs/jffs2/wbuf.c +0 -0
index 09ed551..63f31c0 100644

fs/jffs2/wbuf.c int jffs2_dataflash_setup(struct jffs2_sb_info *c) { · line 1279

Quoted 7 lines
fs/jffs2/wbuf.c +0 -1
@@ -1274,7 +1274,6 @@ int jffs2_dataflash_setup(struct jffs2_sb_info *c) {
 #ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
        c->wbuf_verify = kmalloc(c->wbuf_pagesize, GFP_KERNEL);
        if (!c->wbuf_verify) {
-               kfree(c->oobbuf);
                kfree(c->wbuf);
                return -ENOMEM;
        }

Your patches are whitespace damaged and cannot be applied. Please fix your mailer and resend. Consider retesting by sending to yourself and try using git-am. If all else fails, git-send-email is your friend.

Thanks,
Brian

author
#2 lore raw

Hi Brian,

Sorry, my bad, I configed my editor with expandtab. I'll fix it and test it in my end, then resend it.

Thanks,
Wei

Quoted 30 lines · Brian Norris
Quoted 13 lines · fangwei

c->oobbuf hasn't been kmalloced in jffs2_dataflash_setup, so there is no need to free it.

---
 fs/jffs2/wbuf.c | 1 -
 1 file changed, 1 deletion(-)
fs/jffs2/wbuf.c +0 -0
index 09ed551..63f31c0 100644

fs/jffs2/wbuf.c int jffs2_dataflash_setup(struct jffs2_sb_info *c) { · line 1279

Quoted 7 lines
fs/jffs2/wbuf.c +0 -1
@@ -1274,7 +1274,6 @@ int jffs2_dataflash_setup(struct jffs2_sb_info *c) {
 #ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
        c->wbuf_verify = kmalloc(c->wbuf_pagesize, GFP_KERNEL);
        if (!c->wbuf_verify) {
-               kfree(c->oobbuf);
                kfree(c->wbuf);
                return -ENOMEM;
        }

Your patches are whitespace damaged and cannot be applied. Please fix your mailer and resend. Consider retesting by sending to yourself and try using git-am. If all else fails, git-send-email is your friend.

Thanks,
Brian