summaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-27 15:36:21 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-27 15:36:21 -0700
commit858cbcdd4f7a235f609249b9ca681b7ec5d786a3 (patch)
treeae91051bfcd25d4d1aa8c720d11305115c205114 /arch/sparc/kernel
parentfe31eb679752369240fc8880858a5ed974554eb2 (diff)
parentf5ef9d11fd255b30b455d18f8d721bc44cd1296b (diff)
downloadblackbird-op-linux-858cbcdd4f7a235f609249b9ca681b7ec5d786a3.tar.gz
blackbird-op-linux-858cbcdd4f7a235f609249b9ca681b7ec5d786a3.zip
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: [SPARC]: Fix bus_id[] string overflow.
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r--arch/sparc/kernel/ebus.c8
-rw-r--r--arch/sparc/kernel/of_device.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/arch/sparc/kernel/ebus.c b/arch/sparc/kernel/ebus.c
index 75ac24d229b1..ba58c3a061fd 100644
--- a/arch/sparc/kernel/ebus.c
+++ b/arch/sparc/kernel/ebus.c
@@ -237,12 +237,12 @@ void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *d
dev->ofdev.node = dp;
dev->ofdev.dev.parent = &dev->bus->ofdev.dev;
dev->ofdev.dev.bus = &ebus_bus_type;
- strcpy(dev->ofdev.dev.bus_id, dp->path_component_name);
+ sprintf(dev->ofdev.dev.bus_id, "ebus[%08x]", dp->node);
/* Register with core */
if (of_device_register(&dev->ofdev) != 0)
printk(KERN_DEBUG "ebus: device registration error for %s!\n",
- dev->ofdev.dev.bus_id);
+ dp->path_component_name);
if ((dp = dp->child) != NULL) {
dev->children = (struct linux_ebus_child *)
@@ -332,12 +332,12 @@ void __init ebus_init(void)
ebus->ofdev.node = dp;
ebus->ofdev.dev.parent = &pdev->dev;
ebus->ofdev.dev.bus = &ebus_bus_type;
- strcpy(ebus->ofdev.dev.bus_id, dp->path_component_name);
+ sprintf(ebus->ofdev.dev.bus_id, "ebus%d", num_ebus);
/* Register with core */
if (of_device_register(&ebus->ofdev) != 0)
printk(KERN_DEBUG "ebus: device registration error for %s!\n",
- ebus->ofdev.dev.bus_id);
+ dp->path_component_name);
nd = dp->child;
diff --git a/arch/sparc/kernel/of_device.c b/arch/sparc/kernel/of_device.c
index 74bef2a2d37f..46200c43ffb1 100644
--- a/arch/sparc/kernel/of_device.c
+++ b/arch/sparc/kernel/of_device.c
@@ -651,7 +651,7 @@ build_resources:
if (!parent)
strcpy(op->dev.bus_id, "root");
else
- strcpy(op->dev.bus_id, dp->path_component_name);
+ sprintf(op->dev.bus_id, "%08x", dp->node);
if (of_device_register(op)) {
printk("%s: Could not register of device.\n",
OpenPOWER on IntegriCloud