Re: 2.6.17-mm6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 03 Jul 2006 23:00:34 +1200 Reuben Farrelly wrote:

> Allocate Port Service[0000:00:1c.0:pcie0]
> Allocate Port Service[0000:00:1c.0:pcie0]
> kobject_add failed for 0000:00:1c.0:pcie0 with -EEXIST, don't try to register 
> things with the same name in the same directory.

These names are truncated - they should end with two hex digits:

	snprintf(device->bus_id, sizeof(device->bus_id), "%s:pcie%02x",
		 pci_name(parent), get_descriptor_id(port_type, service_type));

Names were truncated at 18 characters, but sizeof(device->bus_id) is 20
currently, so these names should just fit there.  I see that snprintf()
was changed recently - maybe there is some off-by-one bug there?

And if you want, you can blame me for such long names:

commit 8c9ad508c8737ca46a4c55b1062d159b86f7cee2
Author: Sergey Vlasov <[email protected]>
Date:   Mon Nov 14 20:30:50 2005 +0300

    [PATCH] PCIE: make bus_id for PCI Express devices unique
    
    The bus_id string must be unique for all devices of that bus in the
    system, not just for devices with the same parent - otherwise multiple
    symlinks with identical names appear in /sys/bus/pci_express/devices.
    
    Signed-off-by: Sergey Vlasov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index 467a4ce..e4e5f1e 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -238,8 +238,8 @@ static void pcie_device_init(struct pci_
 	device->driver = NULL;
 	device->driver_data = NULL;
 	device->release = release_pcie_device;	/* callback to free pcie dev */
-	sprintf(&device->bus_id[0], "pcie%02x",
-		get_descriptor_id(port_type, service_type));
+	snprintf(device->bus_id, sizeof(device->bus_id), "%s:pcie%02x",
+		 pci_name(parent), get_descriptor_id(port_type, service_type));
 	device->parent = &parent->dev;
 }
 

Attachment: pgp9sjbFr2jDc.pgp
Description: PGP signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux