lkml.org 
[lkml]   [2018]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.18 47/52] jffs2_kill_sb(): deal with failed allocations
    Date
    3.18-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Al Viro <viro@zeniv.linux.org.uk>

    commit c66b23c2840446a82c389e4cb1a12eb2a71fa2e4 upstream.

    jffs2_fill_super() might fail to allocate jffs2_sb_info;
    jffs2_kill_sb() must survive that.

    Cc: stable@kernel.org
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    fs/jffs2/super.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/fs/jffs2/super.c
    +++ b/fs/jffs2/super.c
    @@ -345,7 +345,7 @@ static void jffs2_put_super (struct supe
    static void jffs2_kill_sb(struct super_block *sb)
    {
    struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
    - if (!(sb->s_flags & MS_RDONLY))
    + if (c && !(sb->s_flags & MS_RDONLY))
    jffs2_stop_garbage_collect_thread(c);
    kill_mtd_super(sb);
    kfree(c);

    \
     
     \ /
      Last update: 2018-04-22 16:26    [W:4.763 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site