Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

simplify the callers of alloc_bprm()

alloc_bprm() starts with do_open_execat() and it will do the right
thing if given ERR_PTR() for name. Allows to drop such checks in
its callers...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro bb850584 2c941f26

+3 -14
+3 -14
fs/exec.c
··· 1782 1782 struct linux_binprm *bprm; 1783 1783 int retval; 1784 1784 1785 - if (IS_ERR(filename)) 1786 - return PTR_ERR(filename); 1787 - 1788 1785 /* 1789 1786 * We move the actual failure in case of RLIMIT_NPROC excess from 1790 1787 * set*uid() to execve() because too many poorly written programs ··· 1859 1862 int kernel_execve(const char *kernel_filename, 1860 1863 const char *const *argv, const char *const *envp) 1861 1864 { 1862 - struct filename *filename; 1863 1865 struct linux_binprm *bprm; 1864 1866 int fd = AT_FDCWD; 1865 1867 int retval; ··· 1867 1871 if (WARN_ON_ONCE(current->flags & PF_KTHREAD)) 1868 1872 return -EINVAL; 1869 1873 1870 - filename = getname_kernel(kernel_filename); 1871 - if (IS_ERR(filename)) 1872 - return PTR_ERR(filename); 1873 - 1874 + CLASS(filename_kernel, filename)(kernel_filename); 1874 1875 bprm = alloc_bprm(fd, filename, 0); 1875 - if (IS_ERR(bprm)) { 1876 - retval = PTR_ERR(bprm); 1877 - goto out_ret; 1878 - } 1876 + if (IS_ERR(bprm)) 1877 + return PTR_ERR(bprm); 1879 1878 1880 1879 retval = count_strings_kernel(argv); 1881 1880 if (WARN_ON_ONCE(retval == 0)) ··· 1904 1913 retval = bprm_execve(bprm); 1905 1914 out_free: 1906 1915 free_bprm(bprm); 1907 - out_ret: 1908 - putname(filename); 1909 1916 return retval; 1910 1917 } 1911 1918