提交 d63fb6c5 编写于 作者: B Benjamin Herrenschmidt 提交者: Linus Torvalds

[PATCH] powermac: Fix some 64b resource damage

The 64 bits resource patches did a bit of damage on PowerMac causing a
buffer overflow in macio_asic and a warning in a sound driver. The
former is fixed by reverting the sprintf of the bus_id to %08x as it was
before. The bus_id used for macio devices is always a 32 bits value
(macio always sits in 32 bits space) and since it's exposed to userland,
the format of the string shouldn't be changed like that anyway. The
second by using the proper type for printk.
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 fc25465f
...@@ -427,10 +427,10 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip, ...@@ -427,10 +427,10 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
/* MacIO itself has a different reg, we use it's PCI base */ /* MacIO itself has a different reg, we use it's PCI base */
if (np == chip->of_node) { if (np == chip->of_node) {
sprintf(dev->ofdev.dev.bus_id, "%1d.%016llx:%.*s", sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s",
chip->lbus.index, chip->lbus.index,
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
(unsigned long long)pci_resource_start(chip->lbus.pdev, 0), (unsigned int)pci_resource_start(chip->lbus.pdev, 0),
#else #else
0, /* NuBus may want to do something better here */ 0, /* NuBus may want to do something better here */
#endif #endif
......
...@@ -1170,7 +1170,7 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return) ...@@ -1170,7 +1170,7 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)
chip->rsrc[i].start + 1, chip->rsrc[i].start + 1,
rnames[i]) == NULL) { rnames[i]) == NULL) {
printk(KERN_ERR "snd: can't request rsrc " printk(KERN_ERR "snd: can't request rsrc "
" %d (%s: 0x%016lx:%016lx)\n", " %d (%s: 0x%016llx:%016llx)\n",
i, rnames[i], i, rnames[i],
(unsigned long long)chip->rsrc[i].start, (unsigned long long)chip->rsrc[i].start,
(unsigned long long)chip->rsrc[i].end); (unsigned long long)chip->rsrc[i].end);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册