From: kalash nainwal Date: Tue, 8 May 2007 07:28:31 +0000 (-0700) Subject: (re)register_binfmt returns with -EBUSY X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=98701d1b0fe98b477b53df89114e6862547f8107;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git (re)register_binfmt returns with -EBUSY When a binary format is unregistered and re-registered, register_binfmt fails with -EBUSY. The reason is that unregister_binfmt does not set fmt->next to NULL, and seeing (fmt->next != NULL), register_binfmt fails with -EBUSY. One can find his way around by explicitly setting fmt->next to NULL after unregistering, but that is kind of unclean (one should better be using only the interfaces, and not the interal members, isn't it?) Attached one-liner can fix it. Signed-off-by: Kalash Nainwal Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/exec.c b/fs/exec.c index f1691cd0c9d2..1ba85c7fc6af 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -100,6 +100,7 @@ int unregister_binfmt(struct linux_binfmt * fmt) while (*tmp) { if (fmt == *tmp) { *tmp = fmt->next; + fmt->next = NULL; write_unlock(&binfmt_lock); return 0; }