Content-Type: multipart/mixed; boundary="===============3738532298538085282==" MIME-Version: 1.0 From: Andrew Morton To: kbuild-all@lists.01.org Subject: Re: [PATCH v1] binfmt_misc: fix crash when load/unload module Date: Mon, 24 Jan 2022 15:16:11 -0800 Message-ID: <20220124151611.30db4381d910c853fc0c9728@linux-foundation.org> In-Reply-To: <202201241937.i9KSsyAj-lkp@intel.com> List-Id: --===============3738532298538085282== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Mon, 24 Jan 2022 19:40:53 +0800 kernel test robot wrot= e: > Hi Tong, > = > = > >> fs/binfmt_misc.c:828:21: error: incompatible pointer types assigning t= o 'struct ctl_table_header *' from 'struct sysctl_header *' [-Werror,-Winco= mpatible-pointer-types] > binfmt_misc_header =3D register_sysctl_mount_point("fs/binfmt_= misc"); > ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~ > 1 error generated. > = > = > vim +828 fs/binfmt_misc.c > = > 821 = > 822 static int __init init_misc_binfmt(void) > 823 { > 824 int err =3D register_filesystem(&bm_fs_type); > 825 if (!err) > 826 insert_binfmt(&misc_format); > 827 = > > 828 binfmt_misc_header =3D register_sysctl_mount_point("fs/binfmt_mis= c"); > 829 if (!binfmt_misc_header) { > 830 pr_warn("Failed to create fs/binfmt_misc sysctl mount point"); > 831 return -ENOMEM; > 832 } > 833 return 0; > 834 } > 835 = This is actually a blooper in Luis's "sysctl: add helper to register a sysctl mount point". Please test, review, ridicule, etc: From: Andrew Morton Subject: include/linux/sysctl.h: fix register_sysctl_mount_point() return t= ype The CONFIG_SYSCTL=3Dn stub returns the wrong type. Fixes: ee9efac48a082 ("sysctl: add helper to register a sysctl mount point") Cc: Luis Chamberlain Cc: Tong Zhang Signed-off-by: Andrew Morton --- include/linux/sysctl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/sysctl.h~a +++ a/include/linux/sysctl.h @@ -265,7 +265,7 @@ static inline struct ctl_table_header *r return NULL; } = -static inline struct sysctl_header *register_sysctl_mount_point(const char= *path) +static inline struct ctl_table_header *register_sysctl_mount_point(const c= har *path) { return NULL; } _ --===============3738532298538085282==--