fs/exec.c: make bprm_mm_init() static
[firefly-linux-kernel-4.4.55.git] / fs / binfmt_elf.c
index 6d7d1647a68c8cf3f8b2c906eb77e23040a49bf5..11e078a747a538a99a0249704c1291b9bcaea21b 100644 (file)
@@ -1140,7 +1140,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma,
 
        /* By default, dump shared memory if mapped from an anonymous file. */
        if (vma->vm_flags & VM_SHARED) {
-               if (vma->vm_file->f_path.dentry->d_inode->i_nlink == 0 ?
+               if (file_inode(vma->vm_file)->i_nlink == 0 ?
                    FILTER(ANON_SHARED) : FILTER(MAPPED_SHARED))
                        goto whole;
                return 0;
@@ -1601,8 +1601,10 @@ static int fill_note_info(struct elfhdr *elf, int phdrs,
        info->thread = NULL;
 
        psinfo = kmalloc(sizeof(*psinfo), GFP_KERNEL);
-       if (psinfo == NULL)
+       if (psinfo == NULL) {
+               info->psinfo.data = NULL; /* So we don't free this wrongly */
                return 0;
+       }
 
        fill_note(&info->psinfo, "CORE", NT_PRPSINFO, sizeof(*psinfo), psinfo);