[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20151022160933.GA1893@bogon>
Date: Fri, 23 Oct 2015 00:09:33 +0800
From: Geliang Tang <geliangtang@....com>
To: Arnd Bergmann <arnd@...db.de>
Cc: Anton Vorontsov <anton@...msg.org>,
Colin Cross <ccross@...roid.com>,
Kees Cook <keescook@...omium.org>,
Tony Luck <tony.luck@...el.com>, linux-kernel@...r.kernel.org,
Geliang Tang <geliangtang@....com>
Subject: Re: [PATCH] pstore: remove __exit annotation for ramoops_remove
On Thu, Oct 22, 2015 at 04:52:33PM +0200, Arnd Bergmann wrote:
> The remove function of a device driver should not be marked
> __exit, because that section gets discarded for built-in drivers,
> and it is still possible to manually unbind a driver from a
> device, which would result in a runtime error.
>
> The kernel also produces a link error for this when the module
> is built-in:
>
> `ramoops_remove' referenced in section `.data' of fs/built-in.o: defined in discarded section `.exit.text' of fs/built-in.o
I can't see why it wasn't reported as an error on my machine.
But I think you are right. __exit should't be there.
Acked-by: Geliang Tang <geliangtang@....com>
>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> Fixes: 2adb611ef932 ("pstore: add pstore unregister")
>
> diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
> index 68889a727bc7..319c3a60cfa5 100644
> --- a/fs/pstore/ram.c
> +++ b/fs/pstore/ram.c
> @@ -578,7 +578,7 @@ fail_out:
> return err;
> }
>
> -static int __exit ramoops_remove(struct platform_device *pdev)
> +static int ramoops_remove(struct platform_device *pdev)
> {
> struct ramoops_context *cxt = &oops_cxt;
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists