From: David Howells Date: Fri, 27 Jun 2008 12:23:20 +0000 (+0100) Subject: PCI: fix pci_setup_device()'s sprinting into a const buffer X-Git-Tag: v2.6.27-rc1~1046^2~19 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=8b285ce84bbc719e363a796f466404576b840d36;p=linux-2.6-omap-h63xx.git PCI: fix pci_setup_device()'s sprinting into a const buffer Make pci_setup_device() write the bus ID directly into the allotted storage, rather than using pci_name() as the address as that now returns a const pointer. Signed-off-by: David Howells Signed-off-by: Jesse Barnes --- diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index f8291191ef9..0420fd8027b 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -713,8 +713,9 @@ static int pci_setup_device(struct pci_dev * dev) { u32 class; - sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus), - dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); + snprintf(dev->dev.bus_id, BUS_ID_SIZE, + "%04x:%02x:%02x.%d", pci_domain_nr(dev->bus), + dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); pci_read_config_dword(dev, PCI_CLASS_REVISION, &class); dev->revision = class & 0xff;