From 6fab2600f9eae779ac49416e651a7f160004c9ae Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Wed, 14 Nov 2007 20:17:24 -0800 Subject: [SPARC64]: Missing mdesc_release() in ldc_init(). Signed-off-by: David S. Miller diff --git a/arch/sparc64/kernel/ldc.c b/arch/sparc64/kernel/ldc.c index 217478a..63969f6 100644 --- a/arch/sparc64/kernel/ldc.c +++ b/arch/sparc64/kernel/ldc.c @@ -2338,6 +2338,7 @@ static int __init ldc_init(void) unsigned long major, minor; struct mdesc_handle *hp; const u64 *v; + int err; u64 mp; hp = mdesc_grab(); @@ -2345,29 +2346,33 @@ static int __init ldc_init(void) return -ENODEV; mp = mdesc_node_by_name(hp, MDESC_NODE_NULL, "platform"); + err = -ENODEV; if (mp == MDESC_NODE_NULL) - return -ENODEV; + goto out; v = mdesc_get_property(hp, mp, "domaining-enabled", NULL); if (!v) - return -ENODEV; + goto out; major = 1; minor = 0; if (sun4v_hvapi_register(HV_GRP_LDOM, major, &minor)) { printk(KERN_INFO PFX "Could not register LDOM hvapi.\n"); - return -ENODEV; + goto out; } printk(KERN_INFO "%s", version); if (!*v) { printk(KERN_INFO PFX "Domaining disabled.\n"); - return -ENODEV; + goto out; } ldom_domaining_enabled = 1; + err = 0; - return 0; +out: + mdesc_release(hp); + return err; } core_initcall(ldc_init); -- cgit v0.10.2 From 874a5f87f53f80b798140b07fcf81f8d3718b3cc Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 19 Nov 2007 21:35:42 -0800 Subject: [SYSCTL_CHECK]: Fix typo in KERN_SPARC_SCONS_PWROFF entry string. Based upon a report by Mikael Pettersson. Signed-off-by: David S. Miller diff --git a/kernel/sysctl_check.c b/kernel/sysctl_check.c index 6972f26..bed939f 100644 --- a/kernel/sysctl_check.c +++ b/kernel/sysctl_check.c @@ -96,7 +96,7 @@ static struct trans_ctl_table trans_kern_table[] = { { KERN_PTY, "pty", trans_pty_table }, { KERN_NGROUPS_MAX, "ngroups_max" }, - { KERN_SPARC_SCONS_PWROFF, "scons_poweroff" }, + { KERN_SPARC_SCONS_PWROFF, "scons-poweroff" }, { KERN_HZ_TIMER, "hz_timer" }, { KERN_UNKNOWN_NMI_PANIC, "unknown_nmi_panic" }, { KERN_BOOTLOADER_TYPE, "bootloader_type" }, -- cgit v0.10.2 From 55c45a3ad8e5f9488426332b7baca0261ec2f816 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Mon, 19 Nov 2007 22:50:01 -0800 Subject: [SPARC64]: Add missing pci_dev_put There should be a pci_dev_put when breaking out of a loop that iterates over calls to pci_get_device and similar functions. Signed-off-by: Julia Lawall Signed-off-by: David S. Miller diff --git a/arch/sparc64/kernel/isa.c b/arch/sparc64/kernel/isa.c index 0f19dce..b5f7b35 100644 --- a/arch/sparc64/kernel/isa.c +++ b/arch/sparc64/kernel/isa.c @@ -155,6 +155,7 @@ void __init isa_init(void) isa_br = kzalloc(sizeof(*isa_br), GFP_KERNEL); if (!isa_br) { printk(KERN_DEBUG "isa: cannot allocate sparc_isa_bridge"); + pci_dev_put(pdev); return; } @@ -168,6 +169,7 @@ void __init isa_init(void) printk(KERN_DEBUG "isa: device registration error for %s!\n", dp->path_component_name); kfree(isa_br); + pci_dev_put(pdev); return; } -- cgit v0.10.2 From 519c4d2debebc82b201b80fdc48643e19233eb97 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Mon, 19 Nov 2007 23:43:00 -0800 Subject: [SPARC64]: Add missing "space" Signed-off-by: Joe Perches Signed-off-by: David S. Miller diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index 7cd8d94..894b506 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c @@ -236,8 +236,9 @@ void smp_synchronize_tick_client(void) t[i].rt, t[i].master, t[i].diff, t[i].lat); #endif - printk(KERN_INFO "CPU %d: synchronized TICK with master CPU (last diff %ld cycles," - "maxerr %lu cycles)\n", smp_processor_id(), delta, rt); + printk(KERN_INFO "CPU %d: synchronized TICK with master CPU " + "(last diff %ld cycles, maxerr %lu cycles)\n", + smp_processor_id(), delta, rt); } static void smp_start_sync_tick_client(int cpu); -- cgit v0.10.2 From 794b26e0600e3aab399f9d0f225f9e0b8782edbb Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Mon, 19 Nov 2007 23:45:16 -0800 Subject: [SPARC]: Add missing "space" Signed-off-by: Joe Perches Signed-off-by: David S. Miller diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index f2d432e..4cd5d78 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c @@ -329,7 +329,7 @@ int __init pcic_probe(void) pcic->pcic_res_cfg_addr.name = "pcic_cfg_addr"; if ((pcic->pcic_config_space_addr = ioremap(regs[2].phys_addr, regs[2].reg_size * 2)) == 0) { - prom_printf("PCIC: Error, cannot map" + prom_printf("PCIC: Error, cannot map " "PCI Configuration Space Address.\n"); prom_halt(); } @@ -341,7 +341,7 @@ int __init pcic_probe(void) pcic->pcic_res_cfg_data.name = "pcic_cfg_data"; if ((pcic->pcic_config_space_data = ioremap(regs[3].phys_addr, regs[3].reg_size * 2)) == 0) { - prom_printf("PCIC: Error, cannot map" + prom_printf("PCIC: Error, cannot map " "PCI Configuration Space Data.\n"); prom_halt(); } @@ -518,8 +518,8 @@ static void pcic_map_pci_device(struct linux_pcic *pcic, * board in a PCI slot. We must remap it * under 64K but it is not done yet. XXX */ - printk("PCIC: Skipping I/O space at 0x%lx," - "this will Oops if a driver attaches;" + printk("PCIC: Skipping I/O space at 0x%lx, " + "this will Oops if a driver attaches " "device '%s' at %02x:%02x)\n", address, namebuf, dev->bus->number, dev->devfn); } -- cgit v0.10.2 From 75c6d1410caa6fea861ef3802e8b186f7685f235 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Tue, 20 Nov 2007 17:32:19 -0800 Subject: [SPARC64]: check for possible NULL pointer dereference This patch adds checking for possible NULL pointer dereference if of_find_property() failed. Signed-off-by: Cyrill Gorcunov Signed-off-by: David S. Miller diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c index 8c4875b..e587a37 100644 --- a/arch/sparc64/kernel/pci_sun4v.c +++ b/arch/sparc64/kernel/pci_sun4v.c @@ -1022,6 +1022,10 @@ void __init sun4v_pci_init(struct device_node *dp, char *model_name) } prop = of_find_property(dp, "reg", NULL); + if (!prop) { + prom_printf("SUN4V_PCI: Could not find config registers\n"); + prom_halt(); + } regs = prop->value; devhandle = (regs->phys_addr >> 32UL) & 0x0fffffff; -- cgit v0.10.2 From b127aa8bafb3b5b555ab0e7d6f87cb8a541a3d46 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Tue, 4 Dec 2007 00:33:07 -0800 Subject: [SPARC]: Add missing of_node_put There should be an of_node_put when breaking out of a loop that iterates using for_each_node_by_type. Signed-off-by: Julia Lawall Signed-off-by: David S. Miller diff --git a/arch/sparc/kernel/devices.c b/arch/sparc/kernel/devices.c index af90a5f..b240b88 100644 --- a/arch/sparc/kernel/devices.c +++ b/arch/sparc/kernel/devices.c @@ -62,8 +62,10 @@ static int __cpu_find_by(int (*compare)(int, int, void *), void *compare_arg, int err = check_cpu_node(dp->node, &cur_inst, compare, compare_arg, prom_node, mid); - if (!err) + if (!err) { + of_node_put(dp); return 0; + } } return -ENODEV; -- cgit v0.10.2 From 9cb1200a286799db897e81bc2b2c1730cfdc9c08 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Tue, 4 Dec 2007 00:38:22 -0800 Subject: [SPARC64]: Update defconfig. Signed-off-by: David S. Miller diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig index 22734ac..f62d9f6 100644 --- a/arch/sparc64/defconfig +++ b/arch/sparc64/defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.24-rc1 -# Wed Oct 31 15:36:47 2007 +# Linux kernel version: 2.6.24-rc4 +# Tue Dec 4 00:37:59 2007 # CONFIG_SPARC=y CONFIG_SPARC64=y @@ -47,6 +47,7 @@ CONFIG_POSIX_MQUEUE=y # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_TASKSTATS is not set # CONFIG_USER_NS is not set +# CONFIG_PID_NS is not set # CONFIG_AUDIT is not set # CONFIG_IKCONFIG is not set CONFIG_LOG_BUF_SHIFT=18 @@ -154,6 +155,7 @@ CONFIG_PCI_DOMAINS=y CONFIG_PCI_SYSCALL=y CONFIG_ARCH_SUPPORTS_MSI=y CONFIG_PCI_MSI=y +# CONFIG_PCI_LEGACY is not set # CONFIG_PCI_DEBUG is not set CONFIG_SUN_OPENPROMFS=m CONFIG_SPARC32_COMPAT=y @@ -359,7 +361,6 @@ CONFIG_IDE_GENERIC=y CONFIG_BLK_DEV_IDEPCI=y # CONFIG_IDEPCI_SHARE_IRQ is not set CONFIG_IDEPCI_PCIBUS_ORDER=y -# CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_GENERIC is not set # CONFIG_BLK_DEV_OPTI621 is not set CONFIG_BLK_DEV_IDEDMA_PCI=y @@ -584,7 +585,6 @@ CONFIG_NIU=m # CONFIG_USB_KAWETH is not set # CONFIG_USB_PEGASUS is not set # CONFIG_USB_RTL8150 is not set -# CONFIG_USB_USBNET_MII is not set # CONFIG_USB_USBNET is not set # CONFIG_WAN is not set # CONFIG_FDDI is not set @@ -780,6 +780,7 @@ CONFIG_HWMON=y # CONFIG_SENSORS_ADT7470 is not set # CONFIG_SENSORS_ATXP1 is not set # CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_I5K_AMB is not set # CONFIG_SENSORS_F71805F is not set # CONFIG_SENSORS_F71882FG is not set # CONFIG_SENSORS_F75375S is not set -- cgit v0.10.2