diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-04-04 12:14:44 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-04-04 12:14:44 -0700 |
commit | db217dece3003df0841bacf9556b5c06aa097dae (patch) | |
tree | 08612e7696c04c4d8fc2207c3ccf2356f945d230 /drivers | |
parent | 8ce42c8b7fdf4fc008a6fc7349beb8f4dd5cb774 (diff) | |
parent | bdd32ce95f79fb5cc964cd789d7ae4500bba7c6f (diff) | |
download | talos-obmc-linux-db217dece3003df0841bacf9556b5c06aa097dae.tar.gz talos-obmc-linux-db217dece3003df0841bacf9556b5c06aa097dae.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
sunxvr500: Ignore secondary output PCI devices.
sparc64: Implement perf_arch_fetch_caller_regs
sparc64: Update defconfig.
sparc64: Fix array size reported by vmemmap_populate()
sparc: Fix regset register window handling.
drivers/serial/sunsu.c: Correct use after free
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/sunsu.c | 4 | ||||
-rw-r--r-- | drivers/video/sunxvr500.c | 24 |
2 files changed, 20 insertions, 8 deletions
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index 170d3d68c8f0..cbcfb1885f79 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c @@ -1453,8 +1453,10 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m if (up->su_type == SU_PORT_KBD || up->su_type == SU_PORT_MS) { err = sunsu_kbd_ms_init(up); if (err) { + of_iounmap(&op->resource[0], + up->port.membase, up->reg_size); kfree(up); - goto out_unmap; + return err; } dev_set_drvdata(&op->dev, up); diff --git a/drivers/video/sunxvr500.c b/drivers/video/sunxvr500.c index 4cd50497264d..3803745d6eee 100644 --- a/drivers/video/sunxvr500.c +++ b/drivers/video/sunxvr500.c @@ -242,11 +242,27 @@ static int __devinit e3d_set_fbinfo(struct e3d_info *ep) static int __devinit e3d_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) { + struct device_node *of_node; + const char *device_type; struct fb_info *info; struct e3d_info *ep; unsigned int line_length; int err; + of_node = pci_device_to_OF_node(pdev); + if (!of_node) { + printk(KERN_ERR "e3d: Cannot find OF node of %s\n", + pci_name(pdev)); + return -ENODEV; + } + + device_type = of_get_property(of_node, "device_type", NULL); + if (!device_type) { + printk(KERN_INFO "e3d: Ignoring secondary output device " + "at %s\n", pci_name(pdev)); + return -ENODEV; + } + err = pci_enable_device(pdev); if (err < 0) { printk(KERN_ERR "e3d: Cannot enable PCI device %s\n", @@ -265,13 +281,7 @@ static int __devinit e3d_pci_register(struct pci_dev *pdev, ep->info = info; ep->pdev = pdev; spin_lock_init(&ep->lock); - ep->of_node = pci_device_to_OF_node(pdev); - if (!ep->of_node) { - printk(KERN_ERR "e3d: Cannot find OF node of %s\n", - pci_name(pdev)); - err = -ENODEV; - goto err_release_fb; - } + ep->of_node = of_node; /* Read the PCI base register of the frame buffer, which we * need in order to interpret the RAMDAC_VID_*FB* values in |