Skip to content

Commit 06fe53b

Browse files
committed
driver core: Early dev_name() depends on slab_is_available().
The early dev_name() setup needs to do an allocation which can only be satisfied under slab_is_available() conditions. Some of the early platform drivers may be initialized before this point, and those still need to contend themselves with an empty dev_name. This fixes up a regression with the SH earlyprintk which was bailing out prior to hitting the early probe path due to not being able to satisfy the early allocation. Other early platform drivers (such as the early timers) that need to match the dev name are sufficiently late that allocations are already possible. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1 parent bd05086 commit 06fe53b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/base/platform.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ static int __init early_platform_driver_probe_id(char *class_str,
12441244
* dev_name() and others to be used before the
12451245
* rest of the driver core is initialized.
12461246
*/
1247-
if (!match->dev.init_name) {
1247+
if (!match->dev.init_name && slab_is_available()) {
12481248
if (match->id != -1)
12491249
match->dev.init_name =
12501250
kasprintf(GFP_KERNEL, "%s.%d",

0 commit comments

Comments
 (0)