Skip to contentSkip to conversation

jffs2: remove unneeded kfree

PATCH In review Wei Fang 2 participants 2 messages Jun 25, 2015 – Jul 6, 2015

Subsystems (2)
lore
Share & tools
lore

Wei Fang

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;
        }

-- 1.8.3.1

#1 lore raw
Quoted 13 lines · Wei Fang

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;
        }

I just realized I responded to your email from months ago. But I see you sent the same patch here. Both are similarly whitespace damaged. Please fix and test on your end before resending again.

Thanks,
Brian