Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
authorLinus Torvalds <torvalds@woody.osdl.org>
Thu, 23 Nov 2006 17:17:16 +0000 (09:17 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Thu, 23 Nov 2006 17:17:16 +0000 (09:17 -0800)
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm:
  [ARM] 3941/1: [Jornada7xx] - Addition to MAINTAINERS
  [ARM] 3942/1: ARM: comment: consistent_sync should not be called directly
  [ARM] ebsa110: fix warnings generated by asm/arch/io.h
  [ARM] 3933/1: Source drivers/ata/Kconfig

45 files changed:
arch/m68knommu/kernel/setup.c
arch/m68knommu/kernel/time.c
arch/m68knommu/platform/5307/ints.c
arch/mips/mm/c-sb1.c
arch/powerpc/kernel/time.c
arch/powerpc/platforms/83xx/mpc832x_mds.c
arch/powerpc/platforms/83xx/mpc834x_itx.c
arch/x86_64/kernel/vmlinux.lds.S
arch/x86_64/mm/init.c
drivers/char/agp/generic.c
drivers/char/agp/intel-agp.c
drivers/char/ftape/zftape/zftape-buffers.c
drivers/cpufreq/Kconfig
drivers/cpufreq/cpufreq.c
drivers/i2c/busses/i2c-ixp4xx.c
drivers/i2c/busses/scx200_acb.c
drivers/infiniband/hw/ipath/Kconfig
drivers/infiniband/ulp/ipoib/ipoib_main.c
drivers/isdn/hisax/Kconfig
drivers/net/tg3.c
drivers/pcmcia/ds.c
fs/xfs/xfs_bmap.c
fs/xfs/xfs_inode.c
include/asm-generic/vmlinux.lds.h
include/asm-m68knommu/irq_regs.h [new file with mode: 0644]
include/asm-m68knommu/irqnode.h
include/asm-m68knommu/machdep.h
include/asm-mips/mach-au1x00/au1xxx_ide.h
include/asm-powerpc/time.h
include/linux/crypto.h
include/linux/igmp.h
include/linux/init.h
kernel/irq/handle.c
kernel/irq/spurious.c
net/bluetooth/hci_event.c
net/bluetooth/hci_sock.c
net/bluetooth/hci_sysfs.c
net/bluetooth/l2cap.c
net/bluetooth/rfcomm/tty.c
net/dccp/ipv6.c
net/ipv6/ip6_tunnel.c
net/ipv6/route.c
net/ipv6/udp.c
net/irda/irlmp.c
net/xfrm/xfrm_user.c

index bde9811cf98c927dcb4bb787bacbdb81a2e6122c..7b21959eaeae66b17f08f5337e42f06cb2842299 100644 (file)
@@ -62,7 +62,7 @@ int (*mach_kbdrate) (struct kbd_repeat *);
 void (*mach_kbd_leds) (unsigned int);
 /* machine dependent irq functions */
 void (*mach_init_IRQ) (void);
-irqreturn_t (*(*mach_default_handler)[]) (int, void *, struct pt_regs *);
+irq_handler_t mach_default_handler;
 int (*mach_get_irq_list) (struct seq_file *, void *);
 void (*mach_process_int) (int irq, struct pt_regs *fp);
 void (*mach_trap_init) (void);
index c5667bdddd5ef263551ef7e6c7633d75bc64a14b..9226264abf1ab610846d9df98afa4a9c9dfca91d 100644 (file)
@@ -54,7 +54,7 @@ static irqreturn_t timer_interrupt(int irq, void *dummy, struct pt_regs * regs)
        update_process_times(user_mode(regs));
 #endif
        if (current->pid)
-               profile_tick(CPU_PROFILING, regs);
+               profile_tick(CPU_PROFILING);
 
        /*
         * If we have an externally synchronized Linux clock, then update
index b4b55093ae7e867a23093883a620e16fc52af909..a57239ec6c8c6fe05453d73330b6034b0e4ea197 100644 (file)
@@ -33,7 +33,7 @@
 /*
  *     This table stores the address info for each vector handler.
  */
-irq_handler_t irq_list[SYS_IRQS];
+struct irq_entry irq_list[SYS_IRQS];
 
 #define NUM_IRQ_NODES 16
 static irq_node_t nodes[NUM_IRQ_NODES];
@@ -44,7 +44,7 @@ volatile unsigned int num_spurious;
 unsigned int local_bh_count[NR_CPUS];
 unsigned int local_irq_count[NR_CPUS];
 
-static irqreturn_t default_irq_handler(int irq, void *ptr, struct pt_regs *regs)
+static irqreturn_t default_irq_handler(int irq, void *ptr)
 {
 #if 1
        printk(KERN_INFO "%s(%d): default irq handler vec=%d [0x%x]\n",
@@ -70,7 +70,7 @@ void __init init_IRQ(void)
 
        for (i = 0; i < SYS_IRQS; i++) {
                if (mach_default_handler)
-                       irq_list[i].handler = (*mach_default_handler)[i];
+                       irq_list[i].handler = mach_default_handler;
                else
                        irq_list[i].handler = default_irq_handler;
                irq_list[i].flags   = IRQ_FLG_STD;
@@ -100,7 +100,7 @@ irq_node_t *new_irq_node(void)
 
 int request_irq(
        unsigned int irq,
-       irqreturn_t (*handler)(int, void *, struct pt_regs *),
+       irq_handler_t handler,
        unsigned long flags,
        const char *devname,
        void *dev_id)
@@ -157,7 +157,7 @@ void free_irq(unsigned int irq, void *dev_id)
        }
 
        if (mach_default_handler)
-               irq_list[irq].handler = (*mach_default_handler)[irq];
+               irq_list[irq].handler = mach_default_handler;
        else
                irq_list[irq].handler = default_irq_handler;
        irq_list[irq].flags   = IRQ_FLG_STD;
@@ -168,8 +168,7 @@ void free_irq(unsigned int irq, void *dev_id)
 EXPORT_SYMBOL(free_irq);
 
 
-int sys_request_irq(unsigned int irq, 
-                    irqreturn_t (*handler)(int, void *, struct pt_regs *), 
+int sys_request_irq(unsigned int irq, irq_handler_t handler, 
                     unsigned long flags, const char *devname, void *dev_id)
 {
        if (irq > IRQ7) {
@@ -211,7 +210,7 @@ void sys_free_irq(unsigned int irq, void *dev_id)
                printk(KERN_WARNING "%s: Removing probably wrong IRQ %d from %s\n",
                       __FUNCTION__, irq, irq_list[irq].devname);
 
-       irq_list[irq].handler = (*mach_default_handler)[irq];
+       irq_list[irq].handler = mach_default_handler;
        irq_list[irq].flags   = 0;
        irq_list[irq].dev_id  = NULL;
        irq_list[irq].devname = NULL;
@@ -241,7 +240,7 @@ asmlinkage void process_int(unsigned long vec, struct pt_regs *fp)
        if (vec >= VEC_INT1 && vec <= VEC_INT7) {
                vec -= VEC_SPUR;
                kstat_cpu(0).irqs[vec]++;
-               irq_list[vec].handler(vec, irq_list[vec].dev_id, fp);
+               irq_list[vec].handler(vec, irq_list[vec].dev_id);
        } else {
                if (mach_process_int)
                        mach_process_int(vec, fp);
index d0ddb4a768a50e6d13e30fea902f1b0d36358040..3a8afd47feaab8b3f1e98e5be73b563acd612282 100644 (file)
@@ -19,6 +19,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 #include <linux/init.h>
+#include <linux/hardirq.h>
 
 #include <asm/asm.h>
 #include <asm/bootinfo.h>
@@ -242,6 +243,25 @@ void sb1_flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsign
        __attribute__((alias("local_sb1_flush_cache_page")));
 #endif
 
+#ifdef CONFIG_SMP
+static void sb1_flush_cache_data_page_ipi(void *info)
+{
+       unsigned long start = (unsigned long)info;
+
+       __sb1_writeback_inv_dcache_range(start, start + PAGE_SIZE);
+}
+
+static void sb1_flush_cache_data_page(unsigned long addr)
+{
+       if (in_atomic())
+               __sb1_writeback_inv_dcache_range(addr, addr + PAGE_SIZE);
+       else
+               on_each_cpu(sb1_flush_cache_data_page_ipi, (void *) addr, 1, 1);
+}
+#else
+void sb1_flush_cache_data_page(unsigned long)
+       __attribute__((alias("local_sb1_flush_cache_data_page")));
+#endif
 
 /*
  * Invalidate all caches on this CPU
@@ -481,7 +501,7 @@ void sb1_cache_init(void)
 
        flush_cache_sigtramp = sb1_flush_cache_sigtramp;
        local_flush_data_cache_page = (void *) sb1_nop;
-       flush_data_cache_page = (void *) sb1_nop;
+       flush_data_cache_page = sb1_flush_cache_data_page;
 
        /* Full flush */
        __flush_cache_all = sb1___flush_cache_all;
index a1b5e4b1615101d448bd52e437b6b7866756fefc..46a24de36fec4bd93acd1fd09983380cf57e5abc 100644 (file)
@@ -1014,48 +1014,6 @@ void __init time_init(void)
        set_dec(tb_ticks_per_jiffy);
 }
 
-#ifdef CONFIG_RTC_CLASS
-static int set_rtc_class_time(struct rtc_time *tm)
-{
-       int err;
-       struct class_device *class_dev =
-               rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
-
-       if (class_dev == NULL)
-               return -ENODEV;
-
-       err = rtc_set_time(class_dev, tm);
-
-       rtc_class_close(class_dev);
-
-       return 0;
-}
-
-static void get_rtc_class_time(struct rtc_time *tm)
-{
-       int err;
-       struct class_device *class_dev =
-               rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
-
-       if (class_dev == NULL)
-               return;
-
-       err = rtc_read_time(class_dev, tm);
-
-       rtc_class_close(class_dev);
-
-       return;
-}
-
-int __init rtc_class_hookup(void)
-{
-       ppc_md.get_rtc_time = get_rtc_class_time;
-       ppc_md.set_rtc_time = set_rtc_class_time;
-
-       return 0;
-}
-#endif /* CONFIG_RTC_CLASS */
-
 
 #define FEBRUARY       2
 #define        STARTOFTIME     1970
index 54dea9d42dc96bc8724d4757561a2b01e1b24746..a43ac71ab740ab9f851ea0a0f90b0f8450e9b8fd 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/root_dev.h>
 #include <linux/initrd.h>
 
+#include <asm/of_device.h>
 #include <asm/system.h>
 #include <asm/atomic.h>
 #include <asm/time.h>
@@ -136,6 +137,24 @@ static void __init mpc832x_sys_setup_arch(void)
 #endif
 }
 
+static int __init mpc832x_declare_of_platform_devices(void)
+{
+       struct device_node *np;
+
+       for (np = NULL; (np = of_find_compatible_node(np, "network",
+                                       "ucc_geth")) != NULL;) {
+               int ucc_num;
+               char bus_id[BUS_ID_SIZE];
+
+               ucc_num = *((uint *) get_property(np, "device-id", NULL)) - 1;
+               snprintf(bus_id, BUS_ID_SIZE, "ucc_geth.%u", ucc_num);
+               of_platform_device_create(np, bus_id, NULL);
+       }
+
+       return 0;
+}
+device_initcall(mpc832x_declare_of_platform_devices);
+
 void __init mpc832x_sys_init_IRQ(void)
 {
 
index 5446bab08eca6eba4a8354418f6b3baa5f1ba4e8..e2bcaaf6b329338ef48bfb1335709c5c9adbe6d7 100644 (file)
@@ -108,10 +108,6 @@ static int __init mpc834x_itx_probe(void)
        return 1;
 }
 
-#ifdef CONFIG_RTC_CLASS
-late_initcall(rtc_class_hookup);
-#endif
-
 define_machine(mpc834x_itx) {
        .name                   = "MPC834x ITX",
        .probe                  = mpc834x_itx_probe,
index edb24aa714b4e0d58f1bbebe70b1e699abb16ce7..d9534e750d4fa548e7f2a016b94fb022ee7689c0 100644 (file)
@@ -60,6 +60,7 @@ SECTIONS
   }
 #endif
 
+  . = ALIGN(PAGE_SIZE);        /* Align data segment to page size boundary */
                                /* Data */
   .data : AT(ADDR(.data) - LOAD_OFFSET) {
        *(.data)
index f1f977aafae1085cd3cd3aaa81fc971620bfc05e..4c0c00ef3ca769c027591b4d5b6483e9b13b9228 100644 (file)
@@ -496,7 +496,7 @@ int remove_memory(u64 start, u64 size)
 }
 EXPORT_SYMBOL_GPL(remove_memory);
 
-#ifndef CONFIG_ACPI_NUMA
+#if !defined(CONFIG_ACPI_NUMA) && defined(CONFIG_NUMA)
 int memory_add_physaddr_to_nid(u64 start)
 {
        return 0;
@@ -504,13 +504,6 @@ int memory_add_physaddr_to_nid(u64 start)
 EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
 #endif
 
-#ifndef CONFIG_ACPI_NUMA
-int memory_add_physaddr_to_nid(u64 start)
-{
-       return 0;
-}
-#endif
-
 #endif /* CONFIG_MEMORY_HOTPLUG */
 
 #ifdef CONFIG_MEMORY_HOTPLUG_RESERVE
index c39200161688eef6ed3b45b6a1de451f4cd67dc9..5ff457b41efbc4b4a349fa4ee90e4413c6249134 100644 (file)
@@ -1054,7 +1054,7 @@ void *agp_generic_alloc_page(struct agp_bridge_data *bridge)
 {
        struct page * page;
 
-       page = alloc_page(GFP_KERNEL);
+       page = alloc_page(GFP_KERNEL | GFP_DMA32);
        if (page == NULL)
                return NULL;
 
index d1ede7db5a12f46027174a41ae52c2692b180bf9..555b3a8ab49c128b5965c5e8c7d4e80eb20cfe4a 100644 (file)
@@ -169,7 +169,7 @@ static void *i8xx_alloc_pages(void)
 {
        struct page * page;
 
-       page = alloc_pages(GFP_KERNEL, 2);
+       page = alloc_pages(GFP_KERNEL | GFP_DMA32, 2);
        if (page == NULL)
                return NULL;
 
@@ -387,11 +387,7 @@ static void intel_i830_init_gtt_entries(void)
        /* We obtain the size of the GTT, which is also stored (for some
         * reason) at the top of stolen memory. Then we add 4KB to that
         * for the video BIOS popup, which is also stored in there. */
-
-       if (IS_I965)
-               size = 512 + 4;
-       else
-               size = agp_bridge->driver->fetch_size() + 4;
+       size = agp_bridge->driver->fetch_size() + 4;
 
        if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82830_HB ||
            agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82845G_HB) {
@@ -805,6 +801,26 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge)
 
        return 0;
 }
+
+/*
+ * The i965 supports 36-bit physical addresses, but to keep
+ * the format of the GTT the same, the bits that don't fit
+ * in a 32-bit word are shifted down to bits 4..7.
+ *
+ * Gcc is smart enough to notice that "(addr >> 28) & 0xf0"
+ * is always zero on 32-bit architectures, so no need to make
+ * this conditional.
+ */
+static unsigned long intel_i965_mask_memory(struct agp_bridge_data *bridge,
+       unsigned long addr, int type)
+{
+       /* Shift high bits down */
+       addr |= (addr >> 28) & 0xf0;
+
+       /* Type checking must be done elsewhere */
+       return addr | bridge->driver->masks[type].mask;
+}
+
 static int intel_i965_fetch_size(void)
 {
        struct aper_size_info_fixed *values;
@@ -832,7 +848,8 @@ static int intel_i965_fetch_size(void)
 
        agp_bridge->previous_size = agp_bridge->current_size = (void *)(values + offset);
 
-       return values[offset].size;
+       /* The i965 GTT is always sized as if it had a 512kB aperture size */
+       return 512;
 }
 
 /* The intel i965 automatically initializes the agp aperture during POST.
@@ -1584,7 +1601,7 @@ static struct agp_bridge_driver intel_i965_driver = {
        .fetch_size             = intel_i965_fetch_size,
        .cleanup                = intel_i915_cleanup,
        .tlb_flush              = intel_i810_tlbflush,
-       .mask_memory            = intel_i810_mask_memory,
+       .mask_memory            = intel_i965_mask_memory,
        .masks                  = intel_i810_masks,
        .agp_enable             = intel_i810_agp_enable,
        .cache_flush            = global_cache_flush,
index da06f138334ecdb58bbd823021cc84c7022c36a0..7ebce2ec78972383ec227d519ec1aa5998a28318 100644 (file)
@@ -85,7 +85,7 @@ int zft_vmalloc_once(void *new, size_t size)
                peak_memory = used_memory;
        }
        TRACE_ABORT(0, ft_t_noise,
-                   "allocated buffer @ %p, %d bytes", *(void **)new, size);
+                   "allocated buffer @ %p, %zd bytes", *(void **)new, size);
 }
 int zft_vmalloc_always(void *new, size_t size)
 {
@@ -101,7 +101,7 @@ void zft_vfree(void *old, size_t size)
        if (*(void **)old) {
                vfree(*(void **)old);
                used_memory -= size;
-               TRACE(ft_t_noise, "released buffer @ %p, %d bytes",
+               TRACE(ft_t_noise, "released buffer @ %p, %zd bytes",
                      *(void **)old, size);
                *(void **)old = NULL;
        }
index 2cc71b66231ec07e81d7221578f040c6fdcaeed0..491779af8d556963e4e86a742af828bd6ea347e0 100644 (file)
@@ -107,6 +107,7 @@ config CPU_FREQ_GOV_USERSPACE
 
 config CPU_FREQ_GOV_ONDEMAND
        tristate "'ondemand' cpufreq policy governor"
+       select CPU_FREQ_TABLE
        help
          'ondemand' - This driver adds a dynamic cpufreq policy governor.
          The governor does a periodic polling and 
index 86e69b7f9122d3639e834307c5a1662e33ee8986..dd0c2623e27be0312eba1220c8d1eb38fe09bef3 100644 (file)
@@ -59,7 +59,7 @@ static int __init init_cpufreq_transition_notifier_list(void)
        srcu_init_notifier_head(&cpufreq_transition_notifier_list);
        return 0;
 }
-core_initcall(init_cpufreq_transition_notifier_list);
+pure_initcall(init_cpufreq_transition_notifier_list);
 
 static LIST_HEAD(cpufreq_governor_list);
 static DEFINE_MUTEX (cpufreq_governor_mutex);
index 1ce01fb0ac09f1139d04480fb9824f738e44f81f..05fffb9415a2d9566afe73ae930be4267ec735d1 100644 (file)
@@ -137,7 +137,8 @@ static int ixp4xx_i2c_probe(struct platform_device *plat_dev)
        gpio_line_set(gpio->scl_pin, 0);
        gpio_line_set(gpio->sda_pin, 0);
 
-       if ((err = i2c_bit_add_bus(&drv_data->adapter) != 0)) {
+       err = i2c_bit_add_bus(&drv_data->adapter);
+       if (err != 0)
                printk(KERN_ERR "ERROR: Could not install %s\n", plat_dev->dev.bus_id);
 
                kfree(drv_data);
index 32aab0d34ee930eb3b9a6f0a95fa752c7f32b7d9..714bae780953c821792ec410597411f722c7df87 100644 (file)
@@ -494,11 +494,12 @@ static __init int scx200_create_pci(const char *text, struct pci_dev *pdev,
        iface->pdev = pdev;
        iface->bar = bar;
 
-       pci_enable_device_bars(iface->pdev, 1 << iface->bar);
+       rc = pci_enable_device_bars(iface->pdev, 1 << iface->bar);
+       if (rc)
+               goto errout_free;
 
        rc = pci_request_region(iface->pdev, iface->bar, iface->adapter.name);
-
-       if (rc != 0) {
+       if (rc) {
                printk(KERN_ERR NAME ": can't allocate PCI BAR %d\n",
                                iface->bar);
                goto errout_free;
index 5ca471ac6542a269d516e89dc3cd7c24b5e275cc..90c14543677de94c1f1a74464d4bbe27ae6ef9cf 100644 (file)
@@ -1,6 +1,6 @@
 config INFINIBAND_IPATH
        tristate "QLogic InfiniPath Driver"
-       depends on (PCI_MSI || HT_IRQ) && 64BIT && INFINIBAND
+       depends on (PCI_MSI || HT_IRQ) && 64BIT && INFINIBAND && NET
        ---help---
        This is a driver for QLogic InfiniPath host channel adapters,
        including InfiniBand verbs support.  This driver allows these
index 1eaf00e9862c5a4a0381d0570b5ac7ee0723f93c..85522daeb946a25a6c4cba91568fbeecf48508bc 100644 (file)
@@ -49,6 +49,8 @@
 
 #include <net/dst.h>
 
+#define IPOIB_QPN(ha) (be32_to_cpup((__be32 *) ha) & 0xffffff)
+
 MODULE_AUTHOR("Roland Dreier");
 MODULE_DESCRIPTION("IP-over-InfiniBand net driver");
 MODULE_LICENSE("Dual BSD/GPL");
@@ -520,8 +522,7 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
                memcpy(&neigh->dgid.raw, &path->pathrec.dgid.raw,
                       sizeof(union ib_gid));
 
-               ipoib_send(dev, skb, path->ah,
-                          be32_to_cpup((__be32 *) skb->dst->neighbour->ha));
+               ipoib_send(dev, skb, path->ah, IPOIB_QPN(skb->dst->neighbour->ha));
        } else {
                neigh->ah  = NULL;
                __skb_queue_tail(&neigh->queue, skb);
@@ -599,8 +600,7 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
                ipoib_dbg(priv, "Send unicast ARP to %04x\n",
                          be16_to_cpu(path->pathrec.dlid));
 
-               ipoib_send(dev, skb, path->ah,
-                          be32_to_cpup((__be32 *) phdr->hwaddr));
+               ipoib_send(dev, skb, path->ah, IPOIB_QPN(phdr->hwaddr));
        } else if ((path->query || !path_rec_start(dev, path)) &&
                   skb_queue_len(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
                /* put pseudoheader back on for next time */
@@ -661,8 +661,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
                                goto out;
                        }
 
-                       ipoib_send(dev, skb, neigh->ah,
-                                  be32_to_cpup((__be32 *) skb->dst->neighbour->ha));
+                       ipoib_send(dev, skb, neigh->ah, IPOIB_QPN(skb->dst->neighbour->ha));
                        goto out;
                }
 
@@ -694,7 +693,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
                                           IPOIB_GID_FMT "\n",
                                           skb->dst ? "neigh" : "dst",
                                           be16_to_cpup((__be16 *) skb->data),
-                                          be32_to_cpup((__be32 *) phdr->hwaddr),
+                                          IPOIB_QPN(phdr->hwaddr),
                                           IPOIB_GID_RAW_ARG(phdr->hwaddr + 4));
                                dev_kfree_skb_any(skb);
                                ++priv->stats.tx_dropped;
@@ -777,7 +776,7 @@ static void ipoib_neigh_destructor(struct neighbour *n)
 
        ipoib_dbg(priv,
                  "neigh_destructor for %06x " IPOIB_GID_FMT "\n",
-                 be32_to_cpup((__be32 *) n->ha),
+                 IPOIB_QPN(n->ha),
                  IPOIB_GID_RAW_ARG(n->ha + 4));
 
        spin_lock_irqsave(&priv->lock, flags);
index eb57a988e0488aac6d5a7f13c48cda909923111c..cfd2718a490d35ed710f595976d6ba72eea1b97b 100644 (file)
@@ -344,7 +344,7 @@ config HISAX_HFC_SX
 
 config HISAX_ENTERNOW_PCI
        bool "Formula-n enter:now PCI card"
-       depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || FRV))
+       depends on HISAX_NETJET && PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || FRV))
        help
          This enables HiSax support for the Formula-n enter:now PCI
          ISDN card.
index 1dbdd6bb587ba11d68c3e4ac53f763edf45ea5c8..c20bb998e0e562c8261b12b7e9b8505f534da47d 100644 (file)
@@ -6979,8 +6979,10 @@ static int tg3_open(struct net_device *dev)
        tg3_full_lock(tp, 0);
 
        err = tg3_set_power_state(tp, PCI_D0);
-       if (err)
+       if (err) {
+               tg3_full_unlock(tp);
                return err;
+       }
 
        tg3_disable_ints(tp);
        tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE;
index 0f701921c13e6e9a781844597380416d19c87c26..a20d84d707d9bff7a264fa4646fa31aa4cb31cc7 100644 (file)
@@ -1271,6 +1271,9 @@ static void pcmcia_bus_remove_socket(struct class_device *class_dev,
        socket->pcmcia_state.dead = 1;
        pccard_register_pcmcia(socket, NULL);
 
+       /* unregister any unbound devices */
+       pcmcia_card_remove(socket, NULL);
+
        pcmcia_put_socket(socket);
 
        return;
index 5b050c06795fbbf3abd51b0f6c77a24daccc33f4..498ad50d1f452807eba88e042f55341ea4498c3d 100644 (file)
@@ -1171,6 +1171,8 @@ xfs_bmap_add_extent_delay_real(
                xfs_bmap_trace_pre_update(fname, "0", ip, idx, XFS_DATA_FORK);
                xfs_bmbt_set_blockcount(ep, temp);
                r[0] = *new;
+               r[1].br_state = PREV.br_state;
+               r[1].br_startblock = 0;
                r[1].br_startoff = new_endoff;
                temp2 = PREV.br_startoff + PREV.br_blockcount - new_endoff;
                r[1].br_blockcount = temp2;
index d72c80dbfbb1fd64629c72b6d5797beb8008624c..44dfac5212856567195068f9570e65f8857709c5 100644 (file)
@@ -2258,7 +2258,7 @@ xfs_ifree_cluster(
                                AIL_LOCK(mp,s);
                                iip->ili_flush_lsn = iip->ili_item.li_lsn;
                                AIL_UNLOCK(mp, s);
-                               xfs_iflags_set(ip, XFS_ISTALE);
+                               xfs_iflags_set(iip->ili_inode, XFS_ISTALE);
                                pre_flushed++;
                        }
                        lip = lip->li_bio_list;
index 9d873163a7ab09dfe605e2a2a49c5176f1b347e9..e60d6f21fa62f25bee576f58b36fea2ead229a7b 100644 (file)
                .notes : { *(.note.*) } :note
 
 #define INITCALLS                                                      \
+       *(.initcall0.init)                                              \
+       *(.initcall0s.init)                                             \
        *(.initcall1.init)                                              \
        *(.initcall1s.init)                                             \
        *(.initcall2.init)                                              \
diff --git a/include/asm-m68knommu/irq_regs.h b/include/asm-m68knommu/irq_regs.h
new file mode 100644 (file)
index 0000000..3dd9c0b
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-generic/irq_regs.h>
index a2503dfc554c59dbc60cbed803d1f464062463de..6132a9858b5236f312bcc91a69222008d3be0e84 100644 (file)
@@ -8,7 +8,7 @@
  * interrupt source (if it supports chaining).
  */
 typedef struct irq_node {
-       irqreturn_t     (*handler)(int, void *, struct pt_regs *);
+       irq_handler_t   handler;
        unsigned long   flags;
        void            *dev_id;
        const char      *devname;
@@ -18,12 +18,12 @@ typedef struct irq_node {
 /*
  * This structure has only 4 elements for speed reasons
  */
-typedef struct irq_handler {
-       irqreturn_t     (*handler)(int, void *, struct pt_regs *);
+struct irq_entry {
+       irq_handler_t   handler;
        unsigned long   flags;
        void            *dev_id;
        const char      *devname;
-} irq_handler_t;
+};
 
 /* count of spurious interrupts */
 extern volatile unsigned int num_spurious;
index 27c90afd3339cfc29054635bcf301dfe180e259e..6ce28f8e0eadd4b7d0a154547922b557cc31a4ee 100644 (file)
@@ -18,7 +18,7 @@ extern int (*mach_kbdrate) (struct kbd_repeat *);
 extern void (*mach_kbd_leds) (unsigned int);
 /* machine dependent irq functions */
 extern void (*mach_init_IRQ) (void);
-extern irqreturn_t (*(*mach_default_handler)[]) (int, void *, struct pt_regs *);
+extern irq_handler_t mach_default_handler;
 extern int (*mach_request_irq) (unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
                                 unsigned long flags, const char *devname, void *dev_id);
 extern void (*mach_free_irq) (unsigned int irq, void *dev_id);
index 301e71300779cb7648c36c47135dafffddb61588..e9fa252f8a3f0deeb8e018b0e7c7cecb455cdb18 100644 (file)
@@ -170,10 +170,8 @@ int __init auide_probe(void);
         static int auide_dma_host_on(ide_drive_t *drive);
         static int auide_dma_lostirq(ide_drive_t *drive);
         static int auide_dma_on(ide_drive_t *drive);
-        static void auide_ddma_tx_callback(int irq, void *param,
-                                           struct pt_regs *regs);
-        static void auide_ddma_rx_callback(int irq, void *param,
-                                           struct pt_regs *regs);
+        static void auide_ddma_tx_callback(int irq, void *param);
+        static void auide_ddma_rx_callback(int irq, void *param);
         static int auide_dma_off_quietly(ide_drive_t *drive);
 #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
 
index a78285010d62f852674327f09a73fda3b7a69a8b..4cff977ad5266c5129ed5eca9114e38a55d258cf 100644 (file)
@@ -39,10 +39,6 @@ extern void generic_calibrate_decr(void);
 extern void wakeup_decrementer(void);
 extern void snapshot_timebase(void);
 
-#ifdef CONFIG_RTC_CLASS
-extern int __init rtc_class_hookup(void);
-#endif
-
 /* Some sane defaults: 125 MHz timebase, 1GHz processor */
 extern unsigned long ppc_proc_freq;
 #define DEFAULT_PROC_FREQ      (DEFAULT_TB_FREQ * 8)
index 8f2ffa4caabfa1c0a425e54fa0c0185eb0fddf3d..6485e9716b36abbc9e0998a95eb35d3b313d41ae 100644 (file)
@@ -245,7 +245,7 @@ int crypto_alg_available(const char *name, u32 flags)
        __deprecated_for_modules;
 int crypto_has_alg(const char *name, u32 type, u32 mask);
 #else
-static int crypto_alg_available(const char *name, u32 flags);
+static int crypto_alg_available(const char *name, u32 flags)
        __deprecated_for_modules;
 static inline int crypto_alg_available(const char *name, u32 flags)
 {
index 03f43e2893a4a6110c55bd50372aeee716e9d113..21dd5690527118b1987c8e24234744c501ca926d 100644 (file)
@@ -191,7 +191,7 @@ struct ip_mc_list
 #define IGMPV3_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value))
 #define IGMPV3_EXP(thresh, nbmant, nbexp, value) \
        ((value) < (thresh) ? (value) : \
-        ((IGMPV3_MASK(value, nbmant) | (1<<(nbmant+nbexp))) << \
+        ((IGMPV3_MASK(value, nbmant) | (1<<(nbmant))) << \
          (IGMPV3_MASK((value) >> (nbmant), nbexp) + (nbexp))))
 
 #define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value)
index ff40ea118e3a7798f2a3a092be3cc238788cbd2c..5eb5d24b7680fea25a97b44df24424e60342658b 100644 (file)
@@ -93,6 +93,14 @@ extern void setup_arch(char **);
        static initcall_t __initcall_##fn##id __attribute_used__ \
        __attribute__((__section__(".initcall" level ".init"))) = fn
 
+/*
+ * A "pure" initcall has no dependencies on anything else, and purely
+ * initializes variables that couldn't be statically initialized.
+ *
+ * This only exists for built-in code, not for modules.
+ */
+#define pure_initcall(fn)              __define_initcall("0",fn,1)
+
 #define core_initcall(fn)              __define_initcall("1",fn,1)
 #define core_initcall_sync(fn)         __define_initcall("1s",fn,1s)
 #define postcore_initcall(fn)          __define_initcall("2",fn,2)
index 42aa6f1a3f0f95e7dce8be2480ab5d209c881db3..a681912bc89a10388e6a4eeecd44dfe05416aff9 100644 (file)
@@ -231,10 +231,10 @@ fastcall unsigned int __do_IRQ(unsigned int irq)
                spin_unlock(&desc->lock);
 
                action_ret = handle_IRQ_event(irq, action);
-
-               spin_lock(&desc->lock);
                if (!noirqdebug)
                        note_interrupt(irq, desc, action_ret);
+
+               spin_lock(&desc->lock);
                if (likely(!(desc->status & IRQ_PENDING)))
                        break;
                desc->status &= ~IRQ_PENDING;
index 9c7e2e4c1fe717ef0f309eed0163a2d28a6cd5a7..543ea2e5ad9301944ab520303bd7fe84e4e92f88 100644 (file)
@@ -147,11 +147,7 @@ void note_interrupt(unsigned int irq, struct irq_desc *desc,
        if (unlikely(irqfixup)) {
                /* Don't punish working computers */
                if ((irqfixup == 2 && irq == 0) || action_ret == IRQ_NONE) {
-                       int ok;
-
-                       spin_unlock(&desc->lock);
-                       ok = misrouted_irq(irq);
-                       spin_lock(&desc->lock);
+                       int ok = misrouted_irq(irq);
                        if (action_ret == IRQ_NONE)
                                desc->irqs_unhandled -= ok;
                }
index 65f094845719126013cfb9f3c1c19e11f4b2b566..bb94e6da223cb6f3535f5fecd611e91d3c0c067f 100644 (file)
@@ -57,6 +57,7 @@
 static void hci_cc_link_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb)
 {
        __u8 status;
+       struct hci_conn *pend;
 
        BT_DBG("%s ocf 0x%x", hdev->name, ocf);
 
@@ -71,6 +72,15 @@ static void hci_cc_link_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb
                        clear_bit(HCI_INQUIRY, &hdev->flags);
                        hci_req_complete(hdev, status);
                }
+
+               hci_dev_lock(hdev);
+
+               pend = hci_conn_hash_lookup_state(hdev, ACL_LINK, BT_CONNECT2);
+               if (pend)
+                       hci_acl_connect(pend);
+
+               hci_dev_unlock(hdev);
+
                break;
 
        default:
@@ -565,11 +575,20 @@ static void hci_cs_info_param(struct hci_dev *hdev, __u16 ocf, __u8 status)
 static inline void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
 {
        __u8 status = *((__u8 *) skb->data);
+       struct hci_conn *pend;
 
        BT_DBG("%s status %d", hdev->name, status);
 
        clear_bit(HCI_INQUIRY, &hdev->flags);
        hci_req_complete(hdev, status);
+
+       hci_dev_lock(hdev);
+
+       pend = hci_conn_hash_lookup_state(hdev, ACL_LINK, BT_CONNECT2);
+       if (pend)
+               hci_acl_connect(pend);
+
+       hci_dev_unlock(hdev);
 }
 
 /* Inquiry Result */
index f26a9eb49945c8805db60c07964b9c1a734f4556..711a085eca5b3436bc13e528a7b03904f74beba2 100644 (file)
@@ -120,10 +120,13 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb)
                        if (!hci_test_bit(evt, &flt->event_mask))
                                continue;
 
-                       if (flt->opcode && ((evt == HCI_EV_CMD_COMPLETE && 
-                                       flt->opcode != *(__u16 *)(skb->data + 3)) ||
-                                       (evt == HCI_EV_CMD_STATUS && 
-                                       flt->opcode != *(__u16 *)(skb->data + 4))))
+                       if (flt->opcode &&
+                           ((evt == HCI_EV_CMD_COMPLETE &&
+                             flt->opcode !=
+                             get_unaligned((__u16 *)(skb->data + 3))) ||
+                            (evt == HCI_EV_CMD_STATUS &&
+                             flt->opcode !=
+                             get_unaligned((__u16 *)(skb->data + 4)))))
                                continue;
                }
 
index 954eb74eb370a34cb97050c9bec17e8cbfdff08c..3eeeb7a86e753cc638993e1ef9214de51adbdfbe 100644 (file)
@@ -259,7 +259,9 @@ void hci_conn_add_sysfs(struct hci_conn *conn)
 
        BT_DBG("conn %p", conn);
 
-       conn->dev.parent  = &hdev->dev;
+       conn->dev.bus = &bt_bus;
+       conn->dev.parent = &hdev->dev;
+
        conn->dev.release = bt_release;
 
        snprintf(conn->dev.bus_id, BUS_ID_SIZE,
index 2b3dcb8f90fadebdcde2ace1feed9cd90cf76b0e..bbf78e6a7bc382d8a6014b1d076c784fbd2a2339 100644 (file)
@@ -1353,12 +1353,12 @@ static inline int l2cap_conf_output(struct sock *sk, void **ptr)
 
        /* Configure output options and let the other side know
         * which ones we don't like. */
-       if (pi->conf_mtu < pi->omtu) {
-               l2cap_add_conf_opt(ptr, L2CAP_CONF_MTU, 2, pi->omtu);
+       if (pi->conf_mtu < pi->omtu)
                result = L2CAP_CONF_UNACCEPT;
-       } else {
+       else
                pi->omtu = pi->conf_mtu;
-       }
+
+       l2cap_add_conf_opt(ptr, L2CAP_CONF_MTU, 2, pi->omtu);
 
        BT_DBG("sk %p result %d", sk, result);
        return result;
@@ -1533,6 +1533,9 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
        if (!(sk = l2cap_get_chan_by_scid(&conn->chan_list, dcid)))
                return -ENOENT;
 
+       if (sk->sk_state == BT_DISCONN)
+               goto unlock;
+
        l2cap_parse_conf_req(sk, req->data, cmd->len - sizeof(*req));
 
        if (flags & 0x0001) {
index b8e3a5f1c8a80683d5806662cc7f55c46a656bee..1fb5d42f37ae959c05dc92df929924250eeca90a 100644 (file)
@@ -765,7 +765,7 @@ static void rfcomm_tty_set_termios(struct tty_struct *tty, struct termios *old)
 
        BT_DBG("tty %p termios %p", tty, old);
 
-       if (!dev)
+       if (!dev || !dev->dlc || !dev->dlc->session)
                return;
 
        /* Handle turning off CRTSCTS */
index eb0ff7ab05ed3a1d4062522cf6f58846c82e3fcd..fc4242c0767ca581df99a61968b9581a9e0f2cae 100644 (file)
@@ -277,7 +277,7 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
        __u64 seq;
 
        sk = inet6_lookup(&dccp_hashinfo, &hdr->daddr, dh->dccph_dport,
-                         &hdr->saddr, dh->dccph_sport, skb->dev->ifindex);
+                         &hdr->saddr, dh->dccph_sport, inet6_iif(skb));
 
        if (sk == NULL) {
                ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS);
index 84d7ebdb9d211103c678579009d6c24dc905379f..b9f40290d12ac35eb7bb55ac5a1ccce14a524628 100644 (file)
@@ -542,6 +542,7 @@ ip6ip6_rcv(struct sk_buff *skb)
                skb->dev = t->dev;
                dst_release(skb->dst);
                skb->dst = NULL;
+               nf_reset(skb);
                if (t->parms.flags & IP6_TNL_F_RCV_DSCP_COPY)
                        ipv6_copy_dscp(ipv6h, skb->nh.ipv6h);
                ip6ip6_ecn_decapsulate(ipv6h, skb);
@@ -1149,6 +1150,20 @@ fail:
        return err;
 }
 
+static void __exit ip6ip6_destroy_tunnels(void)
+{
+       int h;
+       struct ip6_tnl *t;
+
+       for (h = 0; h < HASH_SIZE; h++) {
+               while ((t = tnls_r_l[h]) != NULL)
+                       unregister_netdevice(t->dev);
+       }
+
+       t = tnls_wc[0];
+       unregister_netdevice(t->dev);
+}
+
 /**
  * ip6_tunnel_cleanup - free resources and unregister protocol
  **/
@@ -1158,7 +1173,9 @@ static void __exit ip6_tunnel_cleanup(void)
        if (xfrm6_tunnel_deregister(&ip6ip6_handler))
                printk(KERN_INFO "ip6ip6 close: can't deregister tunnel\n");
 
-       unregister_netdev(ip6ip6_fb_tnl_dev);
+       rtnl_lock();
+       ip6ip6_destroy_tunnels();
+       rtnl_unlock();
 }
 
 module_init(ip6_tunnel_init);
index c953466b7afdbde3c77e6494c3f24a46908d9097..b39ae99122d54a3844f2183130854a45eb459e19 100644 (file)
@@ -330,6 +330,8 @@ static int inline rt6_check_neigh(struct rt6_info *rt)
                read_lock_bh(&neigh->lock);
                if (neigh->nud_state & NUD_VALID)
                        m = 2;
+               else if (!(neigh->nud_state & NUD_FAILED))
+                       m = 1;
                read_unlock_bh(&neigh->lock);
        }
        return m;
@@ -347,9 +349,7 @@ static int rt6_score_route(struct rt6_info *rt, int oif,
        m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2;
 #endif
        n = rt6_check_neigh(rt);
-       if (n > 1)
-               m |= 16;
-       else if (!n && strict & RT6_LOOKUP_F_REACHABLE)
+       if (!n && (strict & RT6_LOOKUP_F_REACHABLE))
                return -1;
        return m;
 }
@@ -380,10 +380,11 @@ static struct rt6_info *rt6_select(struct rt6_info **head, int oif,
                        continue;
 
                if (m > mpri) {
-                       rt6_probe(match);
+                       if (strict & RT6_LOOKUP_F_REACHABLE)
+                               rt6_probe(match);
                        match = rt;
                        mpri = m;
-               } else {
+               } else if (strict & RT6_LOOKUP_F_REACHABLE) {
                        rt6_probe(rt);
                }
        }
@@ -636,7 +637,7 @@ static struct rt6_info *ip6_pol_route_input(struct fib6_table *table,
        int strict = 0;
        int attempts = 3;
        int err;
-       int reachable = RT6_LOOKUP_F_REACHABLE;
+       int reachable = ipv6_devconf.forwarding ? 0 : RT6_LOOKUP_F_REACHABLE;
 
        strict |= flags & RT6_LOOKUP_F_IFACE;
 
@@ -733,7 +734,7 @@ static struct rt6_info *ip6_pol_route_output(struct fib6_table *table,
        int strict = 0;
        int attempts = 3;
        int err;
-       int reachable = RT6_LOOKUP_F_REACHABLE;
+       int reachable = ipv6_devconf.forwarding ? 0 : RT6_LOOKUP_F_REACHABLE;
 
        strict |= flags & RT6_LOOKUP_F_IFACE;
 
index e0c3934a7e4bd82b81135e0e48f097299b3a2510..c83f23e51c469a11bd388eab97b9d80a345db876 100644 (file)
@@ -242,14 +242,13 @@ static void udpv6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 {
        struct ipv6_pinfo *np;
        struct ipv6hdr *hdr = (struct ipv6hdr*)skb->data;
-       struct net_device *dev = skb->dev;
        struct in6_addr *saddr = &hdr->saddr;
        struct in6_addr *daddr = &hdr->daddr;
        struct udphdr *uh = (struct udphdr*)(skb->data+offset);
        struct sock *sk;
        int err;
 
-       sk = udp_v6_lookup(daddr, uh->dest, saddr, uh->source, dev->ifindex);
+       sk = udp_v6_lookup(daddr, uh->dest, saddr, uh->source, inet6_iif(skb));
    
        if (sk == NULL)
                return;
@@ -348,7 +347,7 @@ static void udpv6_mcast_deliver(struct udphdr *uh,
 
        read_lock(&udp_hash_lock);
        sk = sk_head(&udp_hash[ntohs(uh->dest) & (UDP_HTABLE_SIZE - 1)]);
-       dif = skb->dev->ifindex;
+       dif = inet6_iif(skb);
        sk = udp_v6_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif);
        if (!sk) {
                kfree_skb(skb);
@@ -429,7 +428,7 @@ static int udpv6_rcv(struct sk_buff **pskb)
         * check socket cache ... must talk to Alan about his plans
         * for sock caches... i'll skip this for now.
         */
-       sk = udp_v6_lookup(saddr, uh->source, daddr, uh->dest, dev->ifindex);
+       sk = udp_v6_lookup(saddr, uh->source, daddr, uh->dest, inet6_iif(skb));
 
        if (sk == NULL) {
                if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))
index 5073261b9d0c875d7884cf280866f6b324bb36ba..fede83763095085c36d4866c29eeb08d477464e5 100644 (file)
@@ -1678,7 +1678,8 @@ static int irlmp_slsap_inuse(__u8 slsap_sel)
         *  every IrLAP connection and check every LSAP associated with each
         *  the connection.
         */
-       spin_lock_irqsave(&irlmp->links->hb_spinlock, flags);
+       spin_lock_irqsave_nested(&irlmp->links->hb_spinlock, flags,
+                       SINGLE_DEPTH_NESTING);
        lap = (struct lap_cb *) hashbin_get_first(irlmp->links);
        while (lap != NULL) {
                IRDA_ASSERT(lap->magic == LMP_LAP_MAGIC, goto errlap;);
index b43e7647e125692955b8a9ce5081ee3bb7166bb8..c4cde57d9216cc82b529baf8009600583f4a078d 100644 (file)
@@ -1927,6 +1927,9 @@ static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt,
        len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr);
        len += NLMSG_SPACE(sizeof(struct xfrm_user_acquire));
        len += RTA_SPACE(xfrm_user_sec_ctx_size(xp));
+#ifdef CONFIG_XFRM_SUB_POLICY
+       len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
+#endif
        skb = alloc_skb(len, GFP_ATOMIC);
        if (skb == NULL)
                return -ENOMEM;
@@ -2034,6 +2037,9 @@ static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, struct km_eve
        len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr);
        len += NLMSG_SPACE(sizeof(struct xfrm_user_polexpire));
        len += RTA_SPACE(xfrm_user_sec_ctx_size(xp));
+#ifdef CONFIG_XFRM_SUB_POLICY
+       len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
+#endif
        skb = alloc_skb(len, GFP_ATOMIC);
        if (skb == NULL)
                return -ENOMEM;
@@ -2060,6 +2066,9 @@ static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, struct km_event *
                len += RTA_SPACE(headlen);
                headlen = sizeof(*id);
        }
+#ifdef CONFIG_XFRM_SUB_POLICY
+       len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
+#endif
        len += NLMSG_SPACE(headlen);
 
        skb = alloc_skb(len, GFP_ATOMIC);
@@ -2106,10 +2115,12 @@ static int xfrm_notify_policy_flush(struct km_event *c)
        struct nlmsghdr *nlh;
        struct sk_buff *skb;
        unsigned char *b;
+       int len = 0;
 #ifdef CONFIG_XFRM_SUB_POLICY
        struct xfrm_userpolicy_type upt;
+       len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
 #endif
-       int len = NLMSG_LENGTH(0);
+       len += NLMSG_LENGTH(0);
 
        skb = alloc_skb(len, GFP_ATOMIC);
        if (skb == NULL)