• Amir Goldstein's avatar
    fs: move cleanup from init_file() into its callers · dff745c1
    Amir Goldstein authored
    The use of file_free_rcu() in init_file() to free the struct that was
    allocated by the caller was hacky and we got what we deserved.
    
    Let init_file() and its callers take care of cleaning up each after
    their own allocated resources on error.
    
    Fixes: 62d53c4a ("fs: use backing_file container for internal files with "fake" f_path") # mainline only
    Reported-and-tested-by: syzbot+ada42aab05cf51b00e98@syzkaller.appspotmail.com
    Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
    Message-Id: <20230701171134.239409-1-amir73il@gmail.com>
    Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
    dff745c1
file_table.c 12.4 KB