support make_ext4fs
[firefly-linux-kernel-4.4.55.git] / fs / file_table.c
index 666c7ce1fc4150af27d5d0b6f7b4cc9196c5c395..464248f25f4b6d747f985dcccdef6821f35122cf 100644 (file)
@@ -121,13 +121,13 @@ struct file *get_empty_filp(void)
                goto fail;
 
        percpu_counter_inc(&nr_files);
+       f->f_cred = get_cred(cred);
        if (security_file_alloc(f))
                goto fail_sec;
 
        INIT_LIST_HEAD(&f->f_u.fu_list);
        atomic_long_set(&f->f_count, 1);
        rwlock_init(&f->f_owner.lock);
-       f->f_cred = get_cred(cred);
        spin_lock_init(&f->f_lock);
        eventpoll_init_file(f);
        /* f->f_version: 0 */