mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 14:41:27 +00:00
[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>
This commit is contained in:
parent
e803915000
commit
f5ef9d11fd
6 changed files with 16 additions and 16 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue