diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/pm.c | 4 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/mtrr/generic.c | 8 | ||||
-rw-r--r-- | arch/powerpc/kernel/vdso64/gettimeofday.S | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/irq.c | 12 | ||||
-rw-r--r-- | drivers/acpi/asus_acpi.c | 3 | ||||
-rw-r--r-- | drivers/misc/blink.c | 22 | ||||
-rw-r--r-- | drivers/net/irda/irport.c | 2 | ||||
-rw-r--r-- | drivers/net/irda/smsc-ircc2.c | 2 | ||||
-rw-r--r-- | include/asm-frv/pgtable.h | 2 | ||||
-rw-r--r-- | include/asm-sparc64/mdesc.h | 1 | ||||
-rw-r--r-- | include/asm-sparc64/tlb.h | 1 | ||||
-rw-r--r-- | include/linux/pci.h | 11 | ||||
-rw-r--r-- | include/linux/pm.h | 62 | ||||
-rw-r--r-- | kernel/power/main.c | 6 | ||||
-rw-r--r-- | mm/slab.c | 1 | ||||
-rw-r--r-- | net/core/netpoll.c | 30 | ||||
-rw-r--r-- | net/sctp/socket.c | 120 | ||||
-rw-r--r-- | sound/drivers/mts64.c | 2 | ||||
-rw-r--r-- | sound/oss/sb_card.c | 2 |
20 files changed, 209 insertions, 86 deletions
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 22 | 3 | SUBLEVEL = 22 |
4 | EXTRAVERSION = -rc6 | 4 | EXTRAVERSION = -rc7 |
5 | NAME = Holy Dancing Manatees, Batman! | 5 | NAME = Holy Dancing Manatees, Batman! |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 47ff676aca5f..ddf9184d561d 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c | |||
@@ -53,7 +53,7 @@ static suspend_state_t target_state; | |||
53 | /* | 53 | /* |
54 | * Called after processes are frozen, but before we shutdown devices. | 54 | * Called after processes are frozen, but before we shutdown devices. |
55 | */ | 55 | */ |
56 | static int at91_pm_prepare(suspend_state_t state) | 56 | static int at91_pm_set_target(suspend_state_t state) |
57 | { | 57 | { |
58 | target_state = state; | 58 | target_state = state; |
59 | return 0; | 59 | return 0; |
@@ -201,7 +201,7 @@ error: | |||
201 | 201 | ||
202 | static struct pm_ops at91_pm_ops ={ | 202 | static struct pm_ops at91_pm_ops ={ |
203 | .valid = at91_pm_valid_state, | 203 | .valid = at91_pm_valid_state, |
204 | .prepare = at91_pm_prepare, | 204 | .set_target = at91_pm_set_target, |
205 | .enter = at91_pm_enter, | 205 | .enter = at91_pm_enter, |
206 | }; | 206 | }; |
207 | 207 | ||
diff --git a/arch/i386/kernel/cpu/mtrr/generic.c b/arch/i386/kernel/cpu/mtrr/generic.c index 6d5937891b46..f6e46943e6ef 100644 --- a/arch/i386/kernel/cpu/mtrr/generic.c +++ b/arch/i386/kernel/cpu/mtrr/generic.c | |||
@@ -65,7 +65,8 @@ get_fixed_ranges(mtrr_type * frs) | |||
65 | 65 | ||
66 | void mtrr_save_fixed_ranges(void *info) | 66 | void mtrr_save_fixed_ranges(void *info) |
67 | { | 67 | { |
68 | get_fixed_ranges(mtrr_state.fixed_ranges); | 68 | if (cpu_has_mtrr) |
69 | get_fixed_ranges(mtrr_state.fixed_ranges); | ||
69 | } | 70 | } |
70 | 71 | ||
71 | static void print_fixed(unsigned base, unsigned step, const mtrr_type*types) | 72 | static void print_fixed(unsigned base, unsigned step, const mtrr_type*types) |
@@ -469,11 +470,6 @@ int generic_validate_add_page(unsigned long base, unsigned long size, unsigned i | |||
469 | } | 470 | } |
470 | } | 471 | } |
471 | 472 | ||
472 | if (base < 0x100) { | ||
473 | printk(KERN_WARNING "mtrr: cannot set region below 1 MiB (0x%lx000,0x%lx000)\n", | ||
474 | base, size); | ||
475 | return -EINVAL; | ||
476 | } | ||
477 | /* Check upper bits of base and last are equal and lower bits are 0 | 473 | /* Check upper bits of base and last are equal and lower bits are 0 |
478 | for base and 1 for last */ | 474 | for base and 1 for last */ |
479 | last = base + size - 1; | 475 | last = base + size - 1; |
diff --git a/arch/powerpc/kernel/vdso64/gettimeofday.S b/arch/powerpc/kernel/vdso64/gettimeofday.S index 2d7a5104c666..c6401f9e37f1 100644 --- a/arch/powerpc/kernel/vdso64/gettimeofday.S +++ b/arch/powerpc/kernel/vdso64/gettimeofday.S | |||
@@ -31,7 +31,7 @@ V_FUNCTION_BEGIN(__kernel_gettimeofday) | |||
31 | mr r11,r3 /* r11 holds tv */ | 31 | mr r11,r3 /* r11 holds tv */ |
32 | mr r10,r4 /* r10 holds tz */ | 32 | mr r10,r4 /* r10 holds tz */ |
33 | bl V_LOCAL_FUNC(__get_datapage) /* get data page */ | 33 | bl V_LOCAL_FUNC(__get_datapage) /* get data page */ |
34 | cmpldi r10,0 /* check if tv is NULL */ | 34 | cmpldi r11,0 /* check if tv is NULL */ |
35 | beq 2f | 35 | beq 2f |
36 | bl V_LOCAL_FUNC(__do_get_xsec) /* get xsec from tb & kernel */ | 36 | bl V_LOCAL_FUNC(__do_get_xsec) /* get xsec from tb & kernel */ |
37 | lis r7,15 /* r7 = 1000000 = USEC_PER_SEC */ | 37 | lis r7,15 /* r7 = 1000000 = USEC_PER_SEC */ |
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c index e60d283f60bc..6b6165d36fd8 100644 --- a/arch/sparc64/kernel/irq.c +++ b/arch/sparc64/kernel/irq.c | |||
@@ -329,6 +329,10 @@ static void sun4v_irq_enable(unsigned int virt_irq) | |||
329 | if (err != HV_EOK) | 329 | if (err != HV_EOK) |
330 | printk("sun4v_intr_settarget(%x,%lu): err(%d)\n", | 330 | printk("sun4v_intr_settarget(%x,%lu): err(%d)\n", |
331 | ino, cpuid, err); | 331 | ino, cpuid, err); |
332 | err = sun4v_intr_setstate(ino, HV_INTR_STATE_IDLE); | ||
333 | if (err != HV_EOK) | ||
334 | printk("sun4v_intr_setstate(%x): " | ||
335 | "err(%d)\n", ino, err); | ||
332 | err = sun4v_intr_setenabled(ino, HV_INTR_ENABLED); | 336 | err = sun4v_intr_setenabled(ino, HV_INTR_ENABLED); |
333 | if (err != HV_EOK) | 337 | if (err != HV_EOK) |
334 | printk("sun4v_intr_setenabled(%x): err(%d)\n", | 338 | printk("sun4v_intr_setenabled(%x): err(%d)\n", |
@@ -400,6 +404,12 @@ static void sun4v_virq_enable(unsigned int virt_irq) | |||
400 | "err(%d)\n", | 404 | "err(%d)\n", |
401 | dev_handle, dev_ino, cpuid, err); | 405 | dev_handle, dev_ino, cpuid, err); |
402 | err = sun4v_vintr_set_state(dev_handle, dev_ino, | 406 | err = sun4v_vintr_set_state(dev_handle, dev_ino, |
407 | HV_INTR_STATE_IDLE); | ||
408 | if (err != HV_EOK) | ||
409 | printk("sun4v_vintr_set_state(%lx,%lx," | ||
410 | "HV_INTR_STATE_IDLE): err(%d)\n", | ||
411 | dev_handle, dev_ino, err); | ||
412 | err = sun4v_vintr_set_valid(dev_handle, dev_ino, | ||
403 | HV_INTR_ENABLED); | 413 | HV_INTR_ENABLED); |
404 | if (err != HV_EOK) | 414 | if (err != HV_EOK) |
405 | printk("sun4v_vintr_set_state(%lx,%lx," | 415 | printk("sun4v_vintr_set_state(%lx,%lx," |
@@ -420,7 +430,7 @@ static void sun4v_virq_disable(unsigned int virt_irq) | |||
420 | dev_handle = ino & IMAP_IGN; | 430 | dev_handle = ino & IMAP_IGN; |
421 | dev_ino = ino & IMAP_INO; | 431 | dev_ino = ino & IMAP_INO; |
422 | 432 | ||
423 | err = sun4v_vintr_set_state(dev_handle, dev_ino, | 433 | err = sun4v_vintr_set_valid(dev_handle, dev_ino, |
424 | HV_INTR_DISABLED); | 434 | HV_INTR_DISABLED); |
425 | if (err != HV_EOK) | 435 | if (err != HV_EOK) |
426 | printk("sun4v_vintr_set_state(%lx,%lx," | 436 | printk("sun4v_vintr_set_state(%lx,%lx," |
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c index 6d7d4157e049..3cd79caad70c 100644 --- a/drivers/acpi/asus_acpi.c +++ b/drivers/acpi/asus_acpi.c | |||
@@ -1398,7 +1398,7 @@ static int __init asus_acpi_init(void) | |||
1398 | if (!asus_hotk_found) { | 1398 | if (!asus_hotk_found) { |
1399 | acpi_bus_unregister_driver(&asus_hotk_driver); | 1399 | acpi_bus_unregister_driver(&asus_hotk_driver); |
1400 | remove_proc_entry(PROC_ASUS, acpi_root_dir); | 1400 | remove_proc_entry(PROC_ASUS, acpi_root_dir); |
1401 | return result; | 1401 | return -ENODEV; |
1402 | } | 1402 | } |
1403 | 1403 | ||
1404 | asus_backlight_device = backlight_device_register("asus",NULL,NULL, | 1404 | asus_backlight_device = backlight_device_register("asus",NULL,NULL, |
@@ -1407,6 +1407,7 @@ static int __init asus_acpi_init(void) | |||
1407 | printk(KERN_ERR "Could not register asus backlight device\n"); | 1407 | printk(KERN_ERR "Could not register asus backlight device\n"); |
1408 | asus_backlight_device = NULL; | 1408 | asus_backlight_device = NULL; |
1409 | asus_acpi_exit(); | 1409 | asus_acpi_exit(); |
1410 | return -ENODEV; | ||
1410 | } | 1411 | } |
1411 | asus_backlight_device->props.max_brightness = 15; | 1412 | asus_backlight_device->props.max_brightness = 15; |
1412 | 1413 | ||
diff --git a/drivers/misc/blink.c b/drivers/misc/blink.c index 634431ce1184..97f7253ce2d3 100644 --- a/drivers/misc/blink.c +++ b/drivers/misc/blink.c | |||
@@ -16,12 +16,30 @@ static void do_blink(unsigned long data) | |||
16 | add_timer(&blink_timer); | 16 | add_timer(&blink_timer); |
17 | } | 17 | } |
18 | 18 | ||
19 | static int blink_init(void) | 19 | static int blink_panic_event(struct notifier_block *blk, |
20 | unsigned long event, void *arg) | ||
20 | { | 21 | { |
21 | printk(KERN_INFO "Enabling keyboard blinking\n"); | ||
22 | do_blink(0); | 22 | do_blink(0); |
23 | return 0; | 23 | return 0; |
24 | } | 24 | } |
25 | 25 | ||
26 | static struct notifier_block blink_notify = { | ||
27 | .notifier_call = blink_panic_event, | ||
28 | }; | ||
29 | |||
30 | static __init int blink_init(void) | ||
31 | { | ||
32 | printk(KERN_INFO "Enabling keyboard blinking\n"); | ||
33 | atomic_notifier_chain_register(&panic_notifier_list, &blink_notify); | ||
34 | return 0; | ||
35 | } | ||
36 | |||
37 | static __exit void blink_remove(void) | ||
38 | { | ||
39 | del_timer_sync(&blink_timer); | ||
40 | atomic_notifier_chain_unregister(&panic_notifier_list, &blink_notify); | ||
41 | } | ||
42 | |||
26 | module_init(blink_init); | 43 | module_init(blink_init); |
44 | module_exit(blink_remove); | ||
27 | 45 | ||
diff --git a/drivers/net/irda/irport.c b/drivers/net/irda/irport.c index 3098960dc2a1..3078c419cb02 100644 --- a/drivers/net/irda/irport.c +++ b/drivers/net/irda/irport.c | |||
@@ -509,7 +509,7 @@ static void irport_timeout(struct net_device *dev) | |||
509 | IRDA_DEBUG(0, "%s(), iir=%02x, lsr=%02x, iobase=%#x\n", | 509 | IRDA_DEBUG(0, "%s(), iir=%02x, lsr=%02x, iobase=%#x\n", |
510 | __FUNCTION__, iir, lsr, iobase); | 510 | __FUNCTION__, iir, lsr, iobase); |
511 | 511 | ||
512 | IRDA_DEBUG(0, "%s(), transmitting=%d, remain=%d, done=%d\n", | 512 | IRDA_DEBUG(0, "%s(), transmitting=%d, remain=%d, done=%td\n", |
513 | __FUNCTION__, self->transmitting, self->tx_buff.len, | 513 | __FUNCTION__, self->transmitting, self->tx_buff.len, |
514 | self->tx_buff.data - self->tx_buff.head); | 514 | self->tx_buff.data - self->tx_buff.head); |
515 | 515 | ||
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c index 2803b370ba01..36ab98386be0 100644 --- a/drivers/net/irda/smsc-ircc2.c +++ b/drivers/net/irda/smsc-ircc2.c | |||
@@ -79,7 +79,7 @@ MODULE_AUTHOR("Daniele Peri <peri@csai.unipa.it>"); | |||
79 | MODULE_DESCRIPTION("SMC IrCC SIR/FIR controller driver"); | 79 | MODULE_DESCRIPTION("SMC IrCC SIR/FIR controller driver"); |
80 | MODULE_LICENSE("GPL"); | 80 | MODULE_LICENSE("GPL"); |
81 | 81 | ||
82 | static int smsc_nopnp; | 82 | static int smsc_nopnp = 1; |
83 | module_param_named(nopnp, smsc_nopnp, bool, 0); | 83 | module_param_named(nopnp, smsc_nopnp, bool, 0); |
84 | MODULE_PARM_DESC(nopnp, "Do not use PNP to detect controller settings"); | 84 | MODULE_PARM_DESC(nopnp, "Do not use PNP to detect controller settings"); |
85 | 85 | ||
diff --git a/include/asm-frv/pgtable.h b/include/asm-frv/pgtable.h index 2687c7715120..114aefae2701 100644 --- a/include/asm-frv/pgtable.h +++ b/include/asm-frv/pgtable.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/list.h> | 26 | #include <linux/list.h> |
27 | #include <linux/spinlock.h> | 27 | #include <linux/spinlock.h> |
28 | struct mm_struct; | 28 | #include <linux/sched.h> |
29 | struct vm_area_struct; | 29 | struct vm_area_struct; |
30 | #endif | 30 | #endif |
31 | 31 | ||
diff --git a/include/asm-sparc64/mdesc.h b/include/asm-sparc64/mdesc.h index 124eb8ca2378..c6383982b53d 100644 --- a/include/asm-sparc64/mdesc.h +++ b/include/asm-sparc64/mdesc.h | |||
@@ -15,6 +15,7 @@ struct mdesc_node { | |||
15 | u64 node; | 15 | u64 node; |
16 | unsigned int unique_id; | 16 | unsigned int unique_id; |
17 | unsigned int num_arcs; | 17 | unsigned int num_arcs; |
18 | unsigned int irqs[2]; | ||
18 | struct property *properties; | 19 | struct property *properties; |
19 | struct mdesc_node *hash_next; | 20 | struct mdesc_node *hash_next; |
20 | struct mdesc_node *allnodes_next; | 21 | struct mdesc_node *allnodes_next; |
diff --git a/include/asm-sparc64/tlb.h b/include/asm-sparc64/tlb.h index 7af1e1109c49..349d1d3e9c27 100644 --- a/include/asm-sparc64/tlb.h +++ b/include/asm-sparc64/tlb.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _SPARC64_TLB_H | 2 | #define _SPARC64_TLB_H |
3 | 3 | ||
4 | #include <linux/swap.h> | 4 | #include <linux/swap.h> |
5 | #include <linux/pagemap.h> | ||
5 | #include <asm/pgalloc.h> | 6 | #include <asm/pgalloc.h> |
6 | #include <asm/tlbflush.h> | 7 | #include <asm/tlbflush.h> |
7 | #include <asm/mmu_context.h> | 8 | #include <asm/mmu_context.h> |
diff --git a/include/linux/pci.h b/include/linux/pci.h index fbf3766dac1e..086a0e5a6318 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -748,6 +748,17 @@ static inline void pci_release_regions(struct pci_dev *dev) { } | |||
748 | static inline void pci_block_user_cfg_access(struct pci_dev *dev) { } | 748 | static inline void pci_block_user_cfg_access(struct pci_dev *dev) { } |
749 | static inline void pci_unblock_user_cfg_access(struct pci_dev *dev) { } | 749 | static inline void pci_unblock_user_cfg_access(struct pci_dev *dev) { } |
750 | 750 | ||
751 | static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) | ||
752 | { return NULL; } | ||
753 | |||
754 | static inline struct pci_dev *pci_get_slot(struct pci_bus *bus, | ||
755 | unsigned int devfn) | ||
756 | { return NULL; } | ||
757 | |||
758 | static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, | ||
759 | unsigned int devfn) | ||
760 | { return NULL; } | ||
761 | |||
751 | #endif /* CONFIG_PCI */ | 762 | #endif /* CONFIG_PCI */ |
752 | 763 | ||
753 | /* Include architecture-dependent settings and functions */ | 764 | /* Include architecture-dependent settings and functions */ |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 87545e0f0b58..b2c4fde4e994 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -110,37 +110,67 @@ typedef int __bitwise suspend_state_t; | |||
110 | #define PM_SUSPEND_MAX ((__force suspend_state_t) 4) | 110 | #define PM_SUSPEND_MAX ((__force suspend_state_t) 4) |
111 | 111 | ||
112 | /** | 112 | /** |
113 | * struct pm_ops - Callbacks for managing platform dependent suspend states. | 113 | * struct pm_ops - Callbacks for managing platform dependent system sleep |
114 | * @valid: Callback to determine whether the given state can be entered. | 114 | * states. |
115 | * Valid states are advertised in /sys/power/state but can still | ||
116 | * be rejected by prepare or enter if the conditions aren't right. | ||
117 | * There is a %pm_valid_only_mem function available that can be assigned | ||
118 | * to this if you only implement mem sleep. | ||
119 | * | 115 | * |
120 | * @prepare: Prepare the platform for the given suspend state. Can return a | 116 | * @valid: Callback to determine if given system sleep state is supported by |
121 | * negative error code if necessary. | 117 | * the platform. |
118 | * Valid (ie. supported) states are advertised in /sys/power/state. Note | ||
119 | * that it still may be impossible to enter given system sleep state if the | ||
120 | * conditions aren't right. | ||
121 | * There is the %pm_valid_only_mem function available that can be assigned | ||
122 | * to this if the platform only supports mem sleep. | ||
122 | * | 123 | * |
123 | * @enter: Enter the given suspend state, must be assigned. Can return a | 124 | * @set_target: Tell the platform which system sleep state is going to be |
124 | * negative error code if necessary. | 125 | * entered. |
126 | * @set_target() is executed right prior to suspending devices. The | ||
127 | * information conveyed to the platform code by @set_target() should be | ||
128 | * disregarded by the platform as soon as @finish() is executed and if | ||
129 | * @prepare() fails. If @set_target() fails (ie. returns nonzero), | ||
130 | * @prepare(), @enter() and @finish() will not be called by the PM core. | ||
131 | * This callback is optional. However, if it is implemented, the argument | ||
132 | * passed to @prepare(), @enter() and @finish() is meaningless and should | ||
133 | * be ignored. | ||
125 | * | 134 | * |
126 | * @finish: Called when the system has left the given state and all devices | 135 | * @prepare: Prepare the platform for entering the system sleep state indicated |
127 | * are resumed. The return value is ignored. | 136 | * by @set_target() or represented by the argument if @set_target() is not |
137 | * implemented. | ||
138 | * @prepare() is called right after devices have been suspended (ie. the | ||
139 | * appropriate .suspend() method has been executed for each device) and | ||
140 | * before the nonboot CPUs are disabled (it is executed with IRQs enabled). | ||
141 | * This callback is optional. It returns 0 on success or a negative | ||
142 | * error code otherwise, in which case the system cannot enter the desired | ||
143 | * sleep state (@enter() and @finish() will not be called in that case). | ||
144 | * | ||
145 | * @enter: Enter the system sleep state indicated by @set_target() or | ||
146 | * represented by the argument if @set_target() is not implemented. | ||
147 | * This callback is mandatory. It returns 0 on success or a negative | ||
148 | * error code otherwise, in which case the system cannot enter the desired | ||
149 | * sleep state. | ||
150 | * | ||
151 | * @finish: Called when the system has just left a sleep state, right after | ||
152 | * the nonboot CPUs have been enabled and before devices are resumed (it is | ||
153 | * executed with IRQs enabled). If @set_target() is not implemented, the | ||
154 | * argument represents the sleep state being left. | ||
155 | * This callback is optional, but should be implemented by the platforms | ||
156 | * that implement @prepare(). If implemented, it is always called after | ||
157 | * @enter() (even if @enter() fails). | ||
128 | */ | 158 | */ |
129 | struct pm_ops { | 159 | struct pm_ops { |
130 | int (*valid)(suspend_state_t state); | 160 | int (*valid)(suspend_state_t state); |
161 | int (*set_target)(suspend_state_t state); | ||
131 | int (*prepare)(suspend_state_t state); | 162 | int (*prepare)(suspend_state_t state); |
132 | int (*enter)(suspend_state_t state); | 163 | int (*enter)(suspend_state_t state); |
133 | int (*finish)(suspend_state_t state); | 164 | int (*finish)(suspend_state_t state); |
134 | }; | 165 | }; |
135 | 166 | ||
167 | extern struct pm_ops *pm_ops; | ||
168 | |||
136 | /** | 169 | /** |
137 | * pm_set_ops - set platform dependent power management ops | 170 | * pm_set_ops - set platform dependent power management ops |
138 | * @pm_ops: The new power management operations to set. | 171 | * @pm_ops: The new power management operations to set. |
139 | */ | 172 | */ |
140 | extern void pm_set_ops(struct pm_ops *pm_ops); | 173 | extern void pm_set_ops(struct pm_ops *pm_ops); |
141 | extern struct pm_ops *pm_ops; | ||
142 | extern int pm_suspend(suspend_state_t state); | ||
143 | |||
144 | extern int pm_valid_only_mem(suspend_state_t state); | 174 | extern int pm_valid_only_mem(suspend_state_t state); |
145 | 175 | ||
146 | /** | 176 | /** |
@@ -161,6 +191,8 @@ extern void arch_suspend_disable_irqs(void); | |||
161 | */ | 191 | */ |
162 | extern void arch_suspend_enable_irqs(void); | 192 | extern void arch_suspend_enable_irqs(void); |
163 | 193 | ||
194 | extern int pm_suspend(suspend_state_t state); | ||
195 | |||
164 | /* | 196 | /* |
165 | * Device power management | 197 | * Device power management |
166 | */ | 198 | */ |
diff --git a/kernel/power/main.c b/kernel/power/main.c index 8812985f3029..fc45ed22620f 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
16 | #include <linux/errno.h> | 16 | #include <linux/errno.h> |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/pm.h> | ||
19 | #include <linux/console.h> | 18 | #include <linux/console.h> |
20 | #include <linux/cpu.h> | 19 | #include <linux/cpu.h> |
21 | #include <linux/resume-trace.h> | 20 | #include <linux/resume-trace.h> |
@@ -97,6 +96,11 @@ static int suspend_prepare(suspend_state_t state) | |||
97 | } | 96 | } |
98 | } | 97 | } |
99 | 98 | ||
99 | if (pm_ops->set_target) { | ||
100 | error = pm_ops->set_target(state); | ||
101 | if (error) | ||
102 | goto Thaw; | ||
103 | } | ||
100 | suspend_console(); | 104 | suspend_console(); |
101 | error = device_suspend(PMSG_SUSPEND); | 105 | error = device_suspend(PMSG_SUSPEND); |
102 | if (error) { | 106 | if (error) { |
@@ -774,7 +774,6 @@ static inline struct kmem_cache *__find_general_cachep(size_t size, | |||
774 | */ | 774 | */ |
775 | BUG_ON(malloc_sizes[INDEX_AC].cs_cachep == NULL); | 775 | BUG_ON(malloc_sizes[INDEX_AC].cs_cachep == NULL); |
776 | #endif | 776 | #endif |
777 | WARN_ON_ONCE(size == 0); | ||
778 | while (size > csizep->cs_size) | 777 | while (size > csizep->cs_size) |
779 | csizep++; | 778 | csizep++; |
780 | 779 | ||
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 758dafe284c0..cf40ff91ac01 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -72,7 +72,8 @@ static void queue_process(struct work_struct *work) | |||
72 | netif_tx_unlock(dev); | 72 | netif_tx_unlock(dev); |
73 | local_irq_restore(flags); | 73 | local_irq_restore(flags); |
74 | 74 | ||
75 | schedule_delayed_work(&npinfo->tx_work, HZ/10); | 75 | if (atomic_read(&npinfo->refcnt)) |
76 | schedule_delayed_work(&npinfo->tx_work, HZ/10); | ||
76 | return; | 77 | return; |
77 | } | 78 | } |
78 | netif_tx_unlock(dev); | 79 | netif_tx_unlock(dev); |
@@ -250,22 +251,23 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) | |||
250 | unsigned long flags; | 251 | unsigned long flags; |
251 | 252 | ||
252 | local_irq_save(flags); | 253 | local_irq_save(flags); |
253 | if (netif_tx_trylock(dev)) { | 254 | /* try until next clock tick */ |
254 | /* try until next clock tick */ | 255 | for (tries = jiffies_to_usecs(1)/USEC_PER_POLL; |
255 | for (tries = jiffies_to_usecs(1)/USEC_PER_POLL; | 256 | tries > 0; --tries) { |
256 | tries > 0; --tries) { | 257 | if (netif_tx_trylock(dev)) { |
257 | if (!netif_queue_stopped(dev)) | 258 | if (!netif_queue_stopped(dev)) |
258 | status = dev->hard_start_xmit(skb, dev); | 259 | status = dev->hard_start_xmit(skb, dev); |
260 | netif_tx_unlock(dev); | ||
259 | 261 | ||
260 | if (status == NETDEV_TX_OK) | 262 | if (status == NETDEV_TX_OK) |
261 | break; | 263 | break; |
262 | 264 | ||
263 | /* tickle device maybe there is some cleanup */ | ||
264 | netpoll_poll(np); | ||
265 | |||
266 | udelay(USEC_PER_POLL); | ||
267 | } | 265 | } |
268 | netif_tx_unlock(dev); | 266 | |
267 | /* tickle device maybe there is some cleanup */ | ||
268 | netpoll_poll(np); | ||
269 | |||
270 | udelay(USEC_PER_POLL); | ||
269 | } | 271 | } |
270 | local_irq_restore(flags); | 272 | local_irq_restore(flags); |
271 | } | 273 | } |
@@ -784,9 +786,15 @@ void netpoll_cleanup(struct netpoll *np) | |||
784 | if (atomic_dec_and_test(&npinfo->refcnt)) { | 786 | if (atomic_dec_and_test(&npinfo->refcnt)) { |
785 | skb_queue_purge(&npinfo->arp_tx); | 787 | skb_queue_purge(&npinfo->arp_tx); |
786 | skb_queue_purge(&npinfo->txq); | 788 | skb_queue_purge(&npinfo->txq); |
787 | cancel_rearming_delayed_work(&npinfo->tx_work); | 789 | cancel_delayed_work(&npinfo->tx_work); |
788 | flush_scheduled_work(); | 790 | flush_scheduled_work(); |
789 | 791 | ||
792 | /* clean after last, unfinished work */ | ||
793 | if (!skb_queue_empty(&npinfo->txq)) { | ||
794 | struct sk_buff *skb; | ||
795 | skb = __skb_dequeue(&npinfo->txq); | ||
796 | kfree_skb(skb); | ||
797 | } | ||
790 | kfree(npinfo); | 798 | kfree(npinfo); |
791 | } | 799 | } |
792 | } | 800 | } |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 6edaaa009d62..67861a8f00cb 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -3375,12 +3375,13 @@ static int sctp_getsockopt_sctp_status(struct sock *sk, int len, | |||
3375 | sctp_assoc_t associd; | 3375 | sctp_assoc_t associd; |
3376 | int retval = 0; | 3376 | int retval = 0; |
3377 | 3377 | ||
3378 | if (len != sizeof(status)) { | 3378 | if (len < sizeof(status)) { |
3379 | retval = -EINVAL; | 3379 | retval = -EINVAL; |
3380 | goto out; | 3380 | goto out; |
3381 | } | 3381 | } |
3382 | 3382 | ||
3383 | if (copy_from_user(&status, optval, sizeof(status))) { | 3383 | len = sizeof(status); |
3384 | if (copy_from_user(&status, optval, len)) { | ||
3384 | retval = -EFAULT; | 3385 | retval = -EFAULT; |
3385 | goto out; | 3386 | goto out; |
3386 | } | 3387 | } |
@@ -3452,12 +3453,13 @@ static int sctp_getsockopt_peer_addr_info(struct sock *sk, int len, | |||
3452 | struct sctp_transport *transport; | 3453 | struct sctp_transport *transport; |
3453 | int retval = 0; | 3454 | int retval = 0; |
3454 | 3455 | ||
3455 | if (len != sizeof(pinfo)) { | 3456 | if (len < sizeof(pinfo)) { |
3456 | retval = -EINVAL; | 3457 | retval = -EINVAL; |
3457 | goto out; | 3458 | goto out; |
3458 | } | 3459 | } |
3459 | 3460 | ||
3460 | if (copy_from_user(&pinfo, optval, sizeof(pinfo))) { | 3461 | len = sizeof(pinfo); |
3462 | if (copy_from_user(&pinfo, optval, len)) { | ||
3461 | retval = -EFAULT; | 3463 | retval = -EFAULT; |
3462 | goto out; | 3464 | goto out; |
3463 | } | 3465 | } |
@@ -3523,8 +3525,11 @@ static int sctp_getsockopt_disable_fragments(struct sock *sk, int len, | |||
3523 | static int sctp_getsockopt_events(struct sock *sk, int len, char __user *optval, | 3525 | static int sctp_getsockopt_events(struct sock *sk, int len, char __user *optval, |
3524 | int __user *optlen) | 3526 | int __user *optlen) |
3525 | { | 3527 | { |
3526 | if (len != sizeof(struct sctp_event_subscribe)) | 3528 | if (len < sizeof(struct sctp_event_subscribe)) |
3527 | return -EINVAL; | 3529 | return -EINVAL; |
3530 | len = sizeof(struct sctp_event_subscribe); | ||
3531 | if (put_user(len, optlen)) | ||
3532 | return -EFAULT; | ||
3528 | if (copy_to_user(optval, &sctp_sk(sk)->subscribe, len)) | 3533 | if (copy_to_user(optval, &sctp_sk(sk)->subscribe, len)) |
3529 | return -EFAULT; | 3534 | return -EFAULT; |
3530 | return 0; | 3535 | return 0; |
@@ -3546,9 +3551,12 @@ static int sctp_getsockopt_autoclose(struct sock *sk, int len, char __user *optv | |||
3546 | /* Applicable to UDP-style socket only */ | 3551 | /* Applicable to UDP-style socket only */ |
3547 | if (sctp_style(sk, TCP)) | 3552 | if (sctp_style(sk, TCP)) |
3548 | return -EOPNOTSUPP; | 3553 | return -EOPNOTSUPP; |
3549 | if (len != sizeof(int)) | 3554 | if (len < sizeof(int)) |
3550 | return -EINVAL; | 3555 | return -EINVAL; |
3551 | if (copy_to_user(optval, &sctp_sk(sk)->autoclose, len)) | 3556 | len = sizeof(int); |
3557 | if (put_user(len, optlen)) | ||
3558 | return -EFAULT; | ||
3559 | if (copy_to_user(optval, &sctp_sk(sk)->autoclose, sizeof(int))) | ||
3552 | return -EFAULT; | 3560 | return -EFAULT; |
3553 | return 0; | 3561 | return 0; |
3554 | } | 3562 | } |
@@ -3599,8 +3607,9 @@ static int sctp_getsockopt_peeloff(struct sock *sk, int len, char __user *optval | |||
3599 | int retval = 0; | 3607 | int retval = 0; |
3600 | struct sctp_association *asoc; | 3608 | struct sctp_association *asoc; |
3601 | 3609 | ||
3602 | if (len != sizeof(sctp_peeloff_arg_t)) | 3610 | if (len < sizeof(sctp_peeloff_arg_t)) |
3603 | return -EINVAL; | 3611 | return -EINVAL; |
3612 | len = sizeof(sctp_peeloff_arg_t); | ||
3604 | if (copy_from_user(&peeloff, optval, len)) | 3613 | if (copy_from_user(&peeloff, optval, len)) |
3605 | return -EFAULT; | 3614 | return -EFAULT; |
3606 | 3615 | ||
@@ -3628,6 +3637,8 @@ static int sctp_getsockopt_peeloff(struct sock *sk, int len, char __user *optval | |||
3628 | 3637 | ||
3629 | /* Return the fd mapped to the new socket. */ | 3638 | /* Return the fd mapped to the new socket. */ |
3630 | peeloff.sd = retval; | 3639 | peeloff.sd = retval; |
3640 | if (put_user(len, optlen)) | ||
3641 | return -EFAULT; | ||
3631 | if (copy_to_user(optval, &peeloff, len)) | 3642 | if (copy_to_user(optval, &peeloff, len)) |
3632 | retval = -EFAULT; | 3643 | retval = -EFAULT; |
3633 | 3644 | ||
@@ -3736,9 +3747,9 @@ static int sctp_getsockopt_peer_addr_params(struct sock *sk, int len, | |||
3736 | struct sctp_association *asoc = NULL; | 3747 | struct sctp_association *asoc = NULL; |
3737 | struct sctp_sock *sp = sctp_sk(sk); | 3748 | struct sctp_sock *sp = sctp_sk(sk); |
3738 | 3749 | ||
3739 | if (len != sizeof(struct sctp_paddrparams)) | 3750 | if (len < sizeof(struct sctp_paddrparams)) |
3740 | return -EINVAL; | 3751 | return -EINVAL; |
3741 | 3752 | len = sizeof(struct sctp_paddrparams); | |
3742 | if (copy_from_user(¶ms, optval, len)) | 3753 | if (copy_from_user(¶ms, optval, len)) |
3743 | return -EFAULT; | 3754 | return -EFAULT; |
3744 | 3755 | ||
@@ -3837,9 +3848,11 @@ static int sctp_getsockopt_delayed_ack_time(struct sock *sk, int len, | |||
3837 | struct sctp_association *asoc = NULL; | 3848 | struct sctp_association *asoc = NULL; |
3838 | struct sctp_sock *sp = sctp_sk(sk); | 3849 | struct sctp_sock *sp = sctp_sk(sk); |
3839 | 3850 | ||
3840 | if (len != sizeof(struct sctp_assoc_value)) | 3851 | if (len < sizeof(struct sctp_assoc_value)) |
3841 | return - EINVAL; | 3852 | return - EINVAL; |
3842 | 3853 | ||
3854 | len = sizeof(struct sctp_assoc_value); | ||
3855 | |||
3843 | if (copy_from_user(¶ms, optval, len)) | 3856 | if (copy_from_user(¶ms, optval, len)) |
3844 | return -EFAULT; | 3857 | return -EFAULT; |
3845 | 3858 | ||
@@ -3888,8 +3901,11 @@ static int sctp_getsockopt_delayed_ack_time(struct sock *sk, int len, | |||
3888 | */ | 3901 | */ |
3889 | static int sctp_getsockopt_initmsg(struct sock *sk, int len, char __user *optval, int __user *optlen) | 3902 | static int sctp_getsockopt_initmsg(struct sock *sk, int len, char __user *optval, int __user *optlen) |
3890 | { | 3903 | { |
3891 | if (len != sizeof(struct sctp_initmsg)) | 3904 | if (len < sizeof(struct sctp_initmsg)) |
3892 | return -EINVAL; | 3905 | return -EINVAL; |
3906 | len = sizeof(struct sctp_initmsg); | ||
3907 | if (put_user(len, optlen)) | ||
3908 | return -EFAULT; | ||
3893 | if (copy_to_user(optval, &sctp_sk(sk)->initmsg, len)) | 3909 | if (copy_to_user(optval, &sctp_sk(sk)->initmsg, len)) |
3894 | return -EFAULT; | 3910 | return -EFAULT; |
3895 | return 0; | 3911 | return 0; |
@@ -3904,7 +3920,7 @@ static int sctp_getsockopt_peer_addrs_num_old(struct sock *sk, int len, | |||
3904 | struct list_head *pos; | 3920 | struct list_head *pos; |
3905 | int cnt = 0; | 3921 | int cnt = 0; |
3906 | 3922 | ||
3907 | if (len != sizeof(sctp_assoc_t)) | 3923 | if (len < sizeof(sctp_assoc_t)) |
3908 | return -EINVAL; | 3924 | return -EINVAL; |
3909 | 3925 | ||
3910 | if (copy_from_user(&id, optval, sizeof(sctp_assoc_t))) | 3926 | if (copy_from_user(&id, optval, sizeof(sctp_assoc_t))) |
@@ -3940,10 +3956,12 @@ static int sctp_getsockopt_peer_addrs_old(struct sock *sk, int len, | |||
3940 | struct sctp_sock *sp = sctp_sk(sk); | 3956 | struct sctp_sock *sp = sctp_sk(sk); |
3941 | int addrlen; | 3957 | int addrlen; |
3942 | 3958 | ||
3943 | if (len != sizeof(struct sctp_getaddrs_old)) | 3959 | if (len < sizeof(struct sctp_getaddrs_old)) |
3944 | return -EINVAL; | 3960 | return -EINVAL; |
3945 | 3961 | ||
3946 | if (copy_from_user(&getaddrs, optval, sizeof(struct sctp_getaddrs_old))) | 3962 | len = sizeof(struct sctp_getaddrs_old); |
3963 | |||
3964 | if (copy_from_user(&getaddrs, optval, len)) | ||
3947 | return -EFAULT; | 3965 | return -EFAULT; |
3948 | 3966 | ||
3949 | if (getaddrs.addr_num <= 0) return -EINVAL; | 3967 | if (getaddrs.addr_num <= 0) return -EINVAL; |
@@ -3966,7 +3984,9 @@ static int sctp_getsockopt_peer_addrs_old(struct sock *sk, int len, | |||
3966 | if (cnt >= getaddrs.addr_num) break; | 3984 | if (cnt >= getaddrs.addr_num) break; |
3967 | } | 3985 | } |
3968 | getaddrs.addr_num = cnt; | 3986 | getaddrs.addr_num = cnt; |
3969 | if (copy_to_user(optval, &getaddrs, sizeof(struct sctp_getaddrs_old))) | 3987 | if (put_user(len, optlen)) |
3988 | return -EFAULT; | ||
3989 | if (copy_to_user(optval, &getaddrs, len)) | ||
3970 | return -EFAULT; | 3990 | return -EFAULT; |
3971 | 3991 | ||
3972 | return 0; | 3992 | return 0; |
@@ -3999,8 +4019,7 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len, | |||
3999 | return -EINVAL; | 4019 | return -EINVAL; |
4000 | 4020 | ||
4001 | to = optval + offsetof(struct sctp_getaddrs,addrs); | 4021 | to = optval + offsetof(struct sctp_getaddrs,addrs); |
4002 | space_left = len - sizeof(struct sctp_getaddrs) - | 4022 | space_left = len - offsetof(struct sctp_getaddrs,addrs); |
4003 | offsetof(struct sctp_getaddrs,addrs); | ||
4004 | 4023 | ||
4005 | list_for_each(pos, &asoc->peer.transport_addr_list) { | 4024 | list_for_each(pos, &asoc->peer.transport_addr_list) { |
4006 | from = list_entry(pos, struct sctp_transport, transports); | 4025 | from = list_entry(pos, struct sctp_transport, transports); |
@@ -4037,7 +4056,7 @@ static int sctp_getsockopt_local_addrs_num_old(struct sock *sk, int len, | |||
4037 | rwlock_t *addr_lock; | 4056 | rwlock_t *addr_lock; |
4038 | int cnt = 0; | 4057 | int cnt = 0; |
4039 | 4058 | ||
4040 | if (len != sizeof(sctp_assoc_t)) | 4059 | if (len < sizeof(sctp_assoc_t)) |
4041 | return -EINVAL; | 4060 | return -EINVAL; |
4042 | 4061 | ||
4043 | if (copy_from_user(&id, optval, sizeof(sctp_assoc_t))) | 4062 | if (copy_from_user(&id, optval, sizeof(sctp_assoc_t))) |
@@ -4179,10 +4198,11 @@ static int sctp_getsockopt_local_addrs_old(struct sock *sk, int len, | |||
4179 | void *buf; | 4198 | void *buf; |
4180 | int bytes_copied = 0; | 4199 | int bytes_copied = 0; |
4181 | 4200 | ||
4182 | if (len != sizeof(struct sctp_getaddrs_old)) | 4201 | if (len < sizeof(struct sctp_getaddrs_old)) |
4183 | return -EINVAL; | 4202 | return -EINVAL; |
4184 | 4203 | ||
4185 | if (copy_from_user(&getaddrs, optval, sizeof(struct sctp_getaddrs_old))) | 4204 | len = sizeof(struct sctp_getaddrs_old); |
4205 | if (copy_from_user(&getaddrs, optval, len)) | ||
4186 | return -EFAULT; | 4206 | return -EFAULT; |
4187 | 4207 | ||
4188 | if (getaddrs.addr_num <= 0) return -EINVAL; | 4208 | if (getaddrs.addr_num <= 0) return -EINVAL; |
@@ -4254,7 +4274,7 @@ copy_getaddrs: | |||
4254 | 4274 | ||
4255 | /* copy the leading structure back to user */ | 4275 | /* copy the leading structure back to user */ |
4256 | getaddrs.addr_num = cnt; | 4276 | getaddrs.addr_num = cnt; |
4257 | if (copy_to_user(optval, &getaddrs, sizeof(struct sctp_getaddrs_old))) | 4277 | if (copy_to_user(optval, &getaddrs, len)) |
4258 | err = -EFAULT; | 4278 | err = -EFAULT; |
4259 | 4279 | ||
4260 | error: | 4280 | error: |
@@ -4282,7 +4302,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len, | |||
4282 | void *addrs; | 4302 | void *addrs; |
4283 | void *buf; | 4303 | void *buf; |
4284 | 4304 | ||
4285 | if (len <= sizeof(struct sctp_getaddrs)) | 4305 | if (len < sizeof(struct sctp_getaddrs)) |
4286 | return -EINVAL; | 4306 | return -EINVAL; |
4287 | 4307 | ||
4288 | if (copy_from_user(&getaddrs, optval, sizeof(struct sctp_getaddrs))) | 4308 | if (copy_from_user(&getaddrs, optval, sizeof(struct sctp_getaddrs))) |
@@ -4306,8 +4326,8 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len, | |||
4306 | } | 4326 | } |
4307 | 4327 | ||
4308 | to = optval + offsetof(struct sctp_getaddrs,addrs); | 4328 | to = optval + offsetof(struct sctp_getaddrs,addrs); |
4309 | space_left = len - sizeof(struct sctp_getaddrs) - | 4329 | space_left = len - offsetof(struct sctp_getaddrs,addrs); |
4310 | offsetof(struct sctp_getaddrs,addrs); | 4330 | |
4311 | addrs = kmalloc(space_left, GFP_KERNEL); | 4331 | addrs = kmalloc(space_left, GFP_KERNEL); |
4312 | if (!addrs) | 4332 | if (!addrs) |
4313 | return -ENOMEM; | 4333 | return -ENOMEM; |
@@ -4379,10 +4399,12 @@ static int sctp_getsockopt_primary_addr(struct sock *sk, int len, | |||
4379 | struct sctp_association *asoc; | 4399 | struct sctp_association *asoc; |
4380 | struct sctp_sock *sp = sctp_sk(sk); | 4400 | struct sctp_sock *sp = sctp_sk(sk); |
4381 | 4401 | ||
4382 | if (len != sizeof(struct sctp_prim)) | 4402 | if (len < sizeof(struct sctp_prim)) |
4383 | return -EINVAL; | 4403 | return -EINVAL; |
4384 | 4404 | ||
4385 | if (copy_from_user(&prim, optval, sizeof(struct sctp_prim))) | 4405 | len = sizeof(struct sctp_prim); |
4406 | |||
4407 | if (copy_from_user(&prim, optval, len)) | ||
4386 | return -EFAULT; | 4408 | return -EFAULT; |
4387 | 4409 | ||
4388 | asoc = sctp_id2assoc(sk, prim.ssp_assoc_id); | 4410 | asoc = sctp_id2assoc(sk, prim.ssp_assoc_id); |
@@ -4398,7 +4420,9 @@ static int sctp_getsockopt_primary_addr(struct sock *sk, int len, | |||
4398 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, | 4420 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, |
4399 | (union sctp_addr *)&prim.ssp_addr); | 4421 | (union sctp_addr *)&prim.ssp_addr); |
4400 | 4422 | ||
4401 | if (copy_to_user(optval, &prim, sizeof(struct sctp_prim))) | 4423 | if (put_user(len, optlen)) |
4424 | return -EFAULT; | ||
4425 | if (copy_to_user(optval, &prim, len)) | ||
4402 | return -EFAULT; | 4426 | return -EFAULT; |
4403 | 4427 | ||
4404 | return 0; | 4428 | return 0; |
@@ -4415,10 +4439,15 @@ static int sctp_getsockopt_adaptation_layer(struct sock *sk, int len, | |||
4415 | { | 4439 | { |
4416 | struct sctp_setadaptation adaptation; | 4440 | struct sctp_setadaptation adaptation; |
4417 | 4441 | ||
4418 | if (len != sizeof(struct sctp_setadaptation)) | 4442 | if (len < sizeof(struct sctp_setadaptation)) |
4419 | return -EINVAL; | 4443 | return -EINVAL; |
4420 | 4444 | ||
4445 | len = sizeof(struct sctp_setadaptation); | ||
4446 | |||
4421 | adaptation.ssb_adaptation_ind = sctp_sk(sk)->adaptation_ind; | 4447 | adaptation.ssb_adaptation_ind = sctp_sk(sk)->adaptation_ind; |
4448 | |||
4449 | if (put_user(len, optlen)) | ||
4450 | return -EFAULT; | ||
4422 | if (copy_to_user(optval, &adaptation, len)) | 4451 | if (copy_to_user(optval, &adaptation, len)) |
4423 | return -EFAULT; | 4452 | return -EFAULT; |
4424 | 4453 | ||
@@ -4452,9 +4481,12 @@ static int sctp_getsockopt_default_send_param(struct sock *sk, | |||
4452 | struct sctp_association *asoc; | 4481 | struct sctp_association *asoc; |
4453 | struct sctp_sock *sp = sctp_sk(sk); | 4482 | struct sctp_sock *sp = sctp_sk(sk); |
4454 | 4483 | ||
4455 | if (len != sizeof(struct sctp_sndrcvinfo)) | 4484 | if (len < sizeof(struct sctp_sndrcvinfo)) |
4456 | return -EINVAL; | 4485 | return -EINVAL; |
4457 | if (copy_from_user(&info, optval, sizeof(struct sctp_sndrcvinfo))) | 4486 | |
4487 | len = sizeof(struct sctp_sndrcvinfo); | ||
4488 | |||
4489 | if (copy_from_user(&info, optval, len)) | ||
4458 | return -EFAULT; | 4490 | return -EFAULT; |
4459 | 4491 | ||
4460 | asoc = sctp_id2assoc(sk, info.sinfo_assoc_id); | 4492 | asoc = sctp_id2assoc(sk, info.sinfo_assoc_id); |
@@ -4475,7 +4507,9 @@ static int sctp_getsockopt_default_send_param(struct sock *sk, | |||
4475 | info.sinfo_timetolive = sp->default_timetolive; | 4507 | info.sinfo_timetolive = sp->default_timetolive; |
4476 | } | 4508 | } |
4477 | 4509 | ||
4478 | if (copy_to_user(optval, &info, sizeof(struct sctp_sndrcvinfo))) | 4510 | if (put_user(len, optlen)) |
4511 | return -EFAULT; | ||
4512 | if (copy_to_user(optval, &info, len)) | ||
4479 | return -EFAULT; | 4513 | return -EFAULT; |
4480 | 4514 | ||
4481 | return 0; | 4515 | return 0; |
@@ -4526,10 +4560,12 @@ static int sctp_getsockopt_rtoinfo(struct sock *sk, int len, | |||
4526 | struct sctp_rtoinfo rtoinfo; | 4560 | struct sctp_rtoinfo rtoinfo; |
4527 | struct sctp_association *asoc; | 4561 | struct sctp_association *asoc; |
4528 | 4562 | ||
4529 | if (len != sizeof (struct sctp_rtoinfo)) | 4563 | if (len < sizeof (struct sctp_rtoinfo)) |
4530 | return -EINVAL; | 4564 | return -EINVAL; |
4531 | 4565 | ||
4532 | if (copy_from_user(&rtoinfo, optval, sizeof (struct sctp_rtoinfo))) | 4566 | len = sizeof(struct sctp_rtoinfo); |
4567 | |||
4568 | if (copy_from_user(&rtoinfo, optval, len)) | ||
4533 | return -EFAULT; | 4569 | return -EFAULT; |
4534 | 4570 | ||
4535 | asoc = sctp_id2assoc(sk, rtoinfo.srto_assoc_id); | 4571 | asoc = sctp_id2assoc(sk, rtoinfo.srto_assoc_id); |
@@ -4581,11 +4617,12 @@ static int sctp_getsockopt_associnfo(struct sock *sk, int len, | |||
4581 | struct list_head *pos; | 4617 | struct list_head *pos; |
4582 | int cnt = 0; | 4618 | int cnt = 0; |
4583 | 4619 | ||
4584 | if (len != sizeof (struct sctp_assocparams)) | 4620 | if (len < sizeof (struct sctp_assocparams)) |
4585 | return -EINVAL; | 4621 | return -EINVAL; |
4586 | 4622 | ||
4587 | if (copy_from_user(&assocparams, optval, | 4623 | len = sizeof(struct sctp_assocparams); |
4588 | sizeof (struct sctp_assocparams))) | 4624 | |
4625 | if (copy_from_user(&assocparams, optval, len)) | ||
4589 | return -EFAULT; | 4626 | return -EFAULT; |
4590 | 4627 | ||
4591 | asoc = sctp_id2assoc(sk, assocparams.sasoc_assoc_id); | 4628 | asoc = sctp_id2assoc(sk, assocparams.sasoc_assoc_id); |
@@ -4671,9 +4708,11 @@ static int sctp_getsockopt_context(struct sock *sk, int len, | |||
4671 | struct sctp_sock *sp; | 4708 | struct sctp_sock *sp; |
4672 | struct sctp_association *asoc; | 4709 | struct sctp_association *asoc; |
4673 | 4710 | ||
4674 | if (len != sizeof(struct sctp_assoc_value)) | 4711 | if (len < sizeof(struct sctp_assoc_value)) |
4675 | return -EINVAL; | 4712 | return -EINVAL; |
4676 | 4713 | ||
4714 | len = sizeof(struct sctp_assoc_value); | ||
4715 | |||
4677 | if (copy_from_user(¶ms, optval, len)) | 4716 | if (copy_from_user(¶ms, optval, len)) |
4678 | return -EFAULT; | 4717 | return -EFAULT; |
4679 | 4718 | ||
@@ -6084,8 +6123,11 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, | |||
6084 | * queued to the backlog. This prevents a potential race between | 6123 | * queued to the backlog. This prevents a potential race between |
6085 | * backlog processing on the old socket and new-packet processing | 6124 | * backlog processing on the old socket and new-packet processing |
6086 | * on the new socket. | 6125 | * on the new socket. |
6126 | * | ||
6127 | * The caller has just allocated newsk so we can guarantee that other | ||
6128 | * paths won't try to lock it and then oldsk. | ||
6087 | */ | 6129 | */ |
6088 | sctp_lock_sock(newsk); | 6130 | lock_sock_nested(newsk, SINGLE_DEPTH_NESTING); |
6089 | sctp_assoc_migrate(assoc, newsk); | 6131 | sctp_assoc_migrate(assoc, newsk); |
6090 | 6132 | ||
6091 | /* If the association on the newsk is already closed before accept() | 6133 | /* If the association on the newsk is already closed before accept() |
diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c index ebb1bdac7237..2025db5947ae 100644 --- a/sound/drivers/mts64.c +++ b/sound/drivers/mts64.c | |||
@@ -1048,7 +1048,7 @@ static struct platform_driver snd_mts64_driver = { | |||
1048 | /********************************************************************* | 1048 | /********************************************************************* |
1049 | * module init stuff | 1049 | * module init stuff |
1050 | *********************************************************************/ | 1050 | *********************************************************************/ |
1051 | static void __init_or_module snd_mts64_unregister_all(void) | 1051 | static void snd_mts64_unregister_all(void) |
1052 | { | 1052 | { |
1053 | int i; | 1053 | int i; |
1054 | 1054 | ||
diff --git a/sound/oss/sb_card.c b/sound/oss/sb_card.c index 27acd6f29b98..7de18b58f2cd 100644 --- a/sound/oss/sb_card.c +++ b/sound/oss/sb_card.c | |||
@@ -290,7 +290,7 @@ static struct pnp_card_driver sb_pnp_driver = { | |||
290 | MODULE_DEVICE_TABLE(pnp_card, sb_pnp_card_table); | 290 | MODULE_DEVICE_TABLE(pnp_card, sb_pnp_card_table); |
291 | #endif /* CONFIG_PNP */ | 291 | #endif /* CONFIG_PNP */ |
292 | 292 | ||
293 | static void __init_or_module sb_unregister_all(void) | 293 | static void sb_unregister_all(void) |
294 | { | 294 | { |
295 | #ifdef CONFIG_PNP | 295 | #ifdef CONFIG_PNP |
296 | if (pnp_registered) | 296 | if (pnp_registered) |