From: Andrew Lunn <andrew@lunn.ch>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Jason Cooper <jason@lakedaemon.net>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
Gregory Clement <gregory.clement@free-electrons.com>,
linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: orion: fix orion_ge00_switch_board_info initialization
Date: Thu, 22 Feb 2018 14:30:43 +0100 [thread overview]
Message-ID: <20180222133043.GC23008@lunn.ch> (raw)
In-Reply-To: <20180221121856.3241260-1-arnd@arndb.de>
On Wed, Feb 21, 2018 at 01:18:49PM +0100, Arnd Bergmann wrote:
> A section type mismatch warning shows up when building with LTO,
> since orion_ge00_mvmdio_bus_name was put in __initconst but not marked
> const itself:
>
> include/linux/of.h: In function 'spear_setup_of_timer':
> arch/arm/mach-spear/time.c:207:34: error: 'timer_of_match' causes a section type conflict with 'orion_ge00_mvmdio_bus_name'
> static const struct of_device_id timer_of_match[] __initconst = {
> ^
> arch/arm/plat-orion/common.c:475:32: note: 'orion_ge00_mvmdio_bus_name' was declared here
> static __initconst const char *orion_ge00_mvmdio_bus_name = "orion-mii";
> ^
>
> As pointed out by Andrew Lunn, it should in fact be 'const' but not
> '__initconst' because the string is never copied but may be accessed
> after the init sections are freed. To fix that, I get rid of the
> extra symbol and rewrite the initialization in a simpler way that
> assigns both the bus_id and modalias statically.
>
> I spotted another theoretical bug in the same place, where d->netdev[i]
> may be an out of bounds access, this can be fixed by moving the device
> assignment into the loop.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
next prev parent reply other threads:[~2018-02-22 13:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-21 12:18 [PATCH] ARM: orion: fix orion_ge00_switch_board_info initialization Arnd Bergmann
2018-02-22 13:30 ` Andrew Lunn [this message]
2018-02-22 16:49 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180222133043.GC23008@lunn.ch \
--to=andrew@lunn.ch \
--cc=arnd@arndb.de \
--cc=gregory.clement@free-electrons.com \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sebastian.hesselbarth@gmail.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox