diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-10-27 01:03:31 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-10-27 01:03:31 -0700 |
commit | f5ef9d11fd255b30b455d18f8d721bc44cd1296b (patch) | |
tree | 61a31b476ac98c05bf0210b169171aa6afb3e007 /arch/sparc64/kernel/isa.c | |
parent | e80391500078b524083ba51c3df01bbaaecc94bb (diff) | |
download | kernel-crypto-f5ef9d11fd255b30b455d18f8d721bc44cd1296b.tar.gz kernel-crypto-f5ef9d11fd255b30b455d18f8d721bc44cd1296b.tar.xz kernel-crypto-f5ef9d11fd255b30b455d18f8d721bc44cd1296b.zip |
[SPARC]: Fix bus_id[] string overflow.
dp->path_component_name can be larger than ->bus_id[]
so use a different naming scheme for this stuff.
Noticed by Jurij Smakov.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/isa.c')
-rw-r--r-- | arch/sparc64/kernel/isa.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/sparc64/kernel/isa.c b/arch/sparc64/kernel/isa.c index 0f3aec72ef5..f028e68b23f 100644 --- a/arch/sparc64/kernel/isa.c +++ b/arch/sparc64/kernel/isa.c @@ -115,12 +115,12 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br) isa_dev->ofdev.node = dp; isa_dev->ofdev.dev.parent = &isa_br->ofdev.dev; isa_dev->ofdev.dev.bus = &isa_bus_type; - strcpy(isa_dev->ofdev.dev.bus_id, dp->path_component_name); + sprintf(isa_dev->ofdev.dev.bus_id, "isa[%08x]", dp->node); /* Register with core */ if (of_device_register(&isa_dev->ofdev) != 0) { printk(KERN_DEBUG "isa: device registration error for %s!\n", - isa_dev->ofdev.dev.bus_id); + dp->path_component_name); kfree(isa_dev); goto next_sibling; } @@ -191,12 +191,12 @@ void __init isa_init(void) isa_br->ofdev.node = dp; isa_br->ofdev.dev.parent = &pdev->dev; isa_br->ofdev.dev.bus = &isa_bus_type; - strcpy(isa_br->ofdev.dev.bus_id, dp->path_component_name); + sprintf(isa_br->ofdev.dev.bus_id, "isa%d", index); /* Register with core */ if (of_device_register(&isa_br->ofdev) != 0) { printk(KERN_DEBUG "isa: device registration error for %s!\n", - isa_br->ofdev.dev.bus_id); + dp->path_component_name); kfree(isa_br); return; } |