Linux 3.0.58
Greg KH
maintainerI'm announcing the release of the 3.0.58 kernel.
All users of the 3.0 kernel series must upgrade.
The updated 3.0.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.0.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/networking/ip-sysctl.txt | 5 + Makefile | 2 arch/arm/kernel/swp_emulate.c | 2 arch/arm/mm/mmu.c | 2 arch/cris/include/asm/io.h | 39 +++++++++++-- arch/sparc/include/asm/hugetlb.h | 10 ++- arch/x86/kernel/cpu/amd.c | 14 ++++ drivers/acpi/scan.c | 2 drivers/atm/solos-pci.c | 5 + drivers/bluetooth/ath3k.c | 1 drivers/bluetooth/btusb.c | 1 drivers/input/joystick/walkera0701.c | 7 +- drivers/input/serio/i8042-x86ia64io.h | 9 +++ drivers/net/bonding/bond_main.c | 7 ++ drivers/net/bonding/bond_sysfs.c | 2 drivers/net/can/dev.c | 3 - drivers/net/irda/sir_dev.c | 2 drivers/net/ne.c | 1 drivers/net/usb/ipheth.c | 5 + drivers/net/wireless/p54/p54usb.c | 4 + drivers/pci/quirks.c | 7 +- drivers/pnp/pnpacpi/core.c | 2 drivers/rtc/rtc-vt8500.c | 11 ++- drivers/usb/gadget/f_phonet.c | 8 ++ drivers/usb/host/ehci-pci.c | 3 - drivers/usb/host/pci-quirks.c | 4 + drivers/virtio/virtio_ring.c | 7 ++ fs/binfmt_misc.c | 5 + fs/binfmt_script.c | 4 + fs/exec.c | 15 +++++ fs/nfs/client.c | 3 - fs/nfs/dir.c | 11 ++- fs/nfs/super.c | 2 fs/nfsd/nfs4xdr.c | 11 +++ include/asm-generic/tlb.h | 9 +++ include/linux/binfmts.h | 1 include/linux/compiler-gcc.h | 5 + include/linux/page-flags.h | 8 ++ include/linux/pci_ids.h | 1 include/linux/snmp.h | 3 - include/net/tcp.h | 1 kernel/cgroup.c | 2 kernel/irq/manage.c | 23 +++++++- mm/memory.c | 5 + mm/mempolicy.c | 64 +++++++++------------- net/bluetooth/hci_core.c | 2 net/ipv4/proc.c | 3 - net/ipv4/sysctl_net_ipv4.c | 7 ++ net/ipv4/tcp_input.c | 93 ++++++++++++++++++++++++--------- net/sched/sch_htb.c | 2 net/sctp/chunk.c | 20 ++++--- net/sctp/socket.c | 4 - sound/usb/midi.c | 91 ++++++++++++++++++++------------ 53 files changed, 406 insertions(+), 154 deletions(-)
Al Viro (1):
ARM: missing ->mmap_sem around find_vma() in swp_emulate.c
Alan Cox (2):
ne2000: add the right platform device
pnpacpi: fix incorrect TEST_ALPHA() test
Alexander Shiyan (1):
irda: sir_dev: Fix copy/paste typo
Alexander Stein (1):
can: Do not call dev_put if restart timer is running upon close
Andre Przywara (1):
x86, amd: Disable way access filter on Piledriver CPUs
Andy Lutomirski (1):
PCI: Reduce Ricoh 0xe822 SD card reader base clock frequency to 50MHz
Christian Lamparter (1):
p54usb: add USBIDs for two more p54usb devices
Christoffer Dall (1):
mm: Fix PageHead when !CONFIG_PAGEFLAGS_EXTENDED
Corey Minyard (1):
CRIS: fix I/O macros
Dave Kleikamp (1):
sparc: huge_ptep_set_* functions need to call set_huge_pte_at()
David Woodhouse (1):
solos-pci: fix double-free of TX skb in DMA mode
Eric Dumazet (5):
tcp: implement RFC 5961 3.2
tcp: implement RFC 5961 4.2
tcp: refine SYN handling in tcp_validate_incoming
tcp: tcp_replace_ts_recent() should not be called from tcp_validate_incoming()
tcp: RFC 5961 5.2 Blind Data Injection Attack Mitigation
Greg Kroah-Hartman (1):
Linux 3.0.58
Gustavo Padovan (1):
Bluetooth: cancel power_on work when unregistering the device
Hugh Dickins (1):
tmpfs mempolicy: fix /proc/mounts corrupting memory
J. Bruce Fields (1):
nfsd4: fix oops on unusual readlike compound
Jay Purohit (1):
usb/ipheth: Add iPhone 5 support
Kees Cook (1):
exec: do not leave bprm->interp on stack
Marcos Chaparro (1):
Bluetooth: ath3k: Add support for VAIO VPCEH [0489:e027]
Michal Hocko (1):
mm: limit mmu_gather batching to fix soft lockups on !CONFIG_PREEMPT
NeilBrown (1):
NFS: avoid NULL dereference in nfs_destroy_server
Ondrej Zary (1):
x86, 8042: Enable A20 using KBC to fix S3 resume on some MSI laptops
Peter Popovec (1):
Input: walkera0701 - fix crash on startup
Rafael J. Wysocki (1):
ACPI / scan: Do not use dummy HID for system bus ACPI nodes
Russell Webb (1):
xhci: Add Lynx Point LP to list of Intel switchable hosts
Sarveshwar Bandi (1):
bonding: Bonding driver does not consider the gso_max_size/gso_max_segs setting of slave devices.
Sebastian Andrzej Siewior (1):
usb: gadget: phonet: free requests in pn_bind()'s error path
Stefan Hasko (1):
net: sched: integer overflow fix
Steven Rostedt (1):
ftrace: Do not function trace inlined functions
Takashi Iwai (2):
ALSA: usb-audio: Avoid autopm calls after disconnection
ALSA: usb-audio: Fix missing autopm for MIDI input
Tejun Heo (1):
cgroup: remove incorrect dget/dput() pair in cgroup_create_dir()
Thomas Gleixner (1):
genirq: Always force thread affinity
Tomasz Guszkowski (1):
p54usb: add USB ID for T-Com Sinus 154 data II
Tommi Rantala (2):
sctp: fix memory leak in sctp_datamsg_from_user() when copy from user space fails
sctp: fix -ENOMEM result with invalid user space pointer in sendto() syscall
Tony Prisk (2):
drivers/rtc/rtc-vt8500.c: correct handling of CR_24H bitfield drivers/rtc/rtc-vt8500.c: fix handling of data passed in struct rtc_time
Trond Myklebust (1):
NFS: Fix calls to drop_nlink()
Will Deacon (2):
virtio: force vring descriptors to be allocated from lowmem
ARM: mm: use pteval_t to represent page protection values
Xi Wang (1):
nfs: fix null checking in nfs_get_option_str()
[email protected] (1):
bonding: fix race condition in bonding_store_slaves_active
Greg KH
maintainerDocumentation/networking/ip-sysctl.txt +5 -0
@@ -534,6 +534,11 @@ tcp_thin_dupack - BOOLEAN Documentation/networking/tcp-thin.txt Default: 0 +tcp_challenge_ack_limit - INTEGER + Limits number of Challenge ACK sent per second, as recommended + in RFC 5961 (Improving TCP's Robustness to Blind In-Window Attacks) + Default: 100 + UDP variables: udp_mem - vector of 3 INTEGERs: min, pressure, max
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 0 -SUBLEVEL = 57 +SUBLEVEL = 58 EXTRAVERSION = NAME = Sneaky Weasel
arch/arm/kernel/swp_emulate.c +2 -0
@@ -108,10 +108,12 @@ static void set_segfault(struct pt_regs *regs, unsigned long addr) {siginfo_t info; +down_read (¤t->mm->mmap_sem);if (find_vma (current->mm, addr) ==NULL ) info.si_code =SEGV_MAPERR ;else info.si_code =SEGV_ACCERR ; +up_read (¤t->mm->mmap_sem); info.si_signo =SIGSEGV ; info.si_errno =0 ;
arch/arm/mm/mmu.c +1 -1
@@ -467,7 +467,7 @@ static void __init build_mem_type_table(void) }for (i =0 ; i <16 ; i++) { -unsigned long v =pgprot_val (protection_map[i]); +pteval_t v =pgprot_val (protection_map[i]); protection_map[i] =__pgprot (v | user_pgprot); }
arch/cris/include/asm/io.h +33 -6
@@ -133,12 +133,39 @@ static inline void writel(unsigned int b, volatile void __iomem *addr)#define insb (port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,1,count) : 0)#define insw (port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,2,count) : 0)#define insl (port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,4,count) : 0) -#define outb (data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,1,1) -#define outw (data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,2,1) -#define outl (data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,4,1) -#define outsb (port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,1,count) -#define outsw (port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,2,count) -#define outsl (port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,3,count) +static inline void outb (unsigned char data,unsigned int port) +{ +if (cris_iops) + cris_iops->write_io (port, (void *) &data,1 ,1 ); +} +static inline void outw (unsigned short data,unsigned int port) +{ +if (cris_iops) + cris_iops->write_io (port, (void *) &data,2 ,1 ); +} +static inline void outl (unsigned int data,unsigned int port) +{ +if (cris_iops) + cris_iops->write_io (port, (void *) &data,4 ,1 ); +} +static inline void outsb (unsigned int port,const void *addr, +unsigned long count) +{ +if (cris_iops) + cris_iops->write_io (port, (void *)addr,1 , count); +} +static inline void outsw (unsigned int port,const void *addr, +unsigned long count) +{ +if (cris_iops) + cris_iops->write_io (port, (void *)addr,2 , count); +} +static inline void outsl (unsigned int port,const void *addr, +unsigned long count) +{ +if (cris_iops) + cris_iops->write_io (port, (void *)addr,4 , count); +}/* * Convert a physical pointer to a virtual kernel pointer for /dev/mem
arch/sparc/include/asm/hugetlb.h +8 -2
@@ -58,14 +58,20 @@ static inline pte_t huge_pte_wrprotect(pte_t pte)static inline void huge_ptep_set_wrprotect (struct mm_struct *mm,unsigned long addr,pte_t *ptep) { -ptep_set_wrprotect (mm, addr, ptep); +pte_t old_pte = *ptep; +set_huge_pte_at (mm, addr, ptep,pte_wrprotect (old_pte)); }static inline int huge_ptep_set_access_flags (struct vm_area_struct *vma,unsigned long addr,pte_t *ptep,pte_t pte,int dirty) { -return ptep_set_access_flags (vma, addr, ptep, pte, dirty); +int changed = !pte_same (*ptep, pte); +if (changed) { +set_huge_pte_at (vma->vm_mm, addr, ptep, pte); +flush_tlb_page (vma, addr); + } +return changed; }static inline pte_t huge_ptep_get (pte_t *ptep)
arch/x86/kernel/cpu/amd.c +14 -0
@@ -554,6 +554,20 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) } } +/* +* The way access filter has a performance penalty on some workloads. +* Disable it on the affected CPUs. +*/ +if ((c->x86 ==0x15 ) && + (c->x86_model >=0x02 ) && (c->x86_model <0x20 )) { +u64 val; + +if (!rdmsrl_safe (0xc0011021 , &val) && !(val &0x1E )) { + val |=0x1E ; +checking_wrmsrl (0xc0011021 , val); + } + } +cpu_detect_cache_sizes (c);/* Multi core CPU? */
drivers/acpi/scan.c +1 -1
@@ -1153,7 +1153,7 @@ static void acpi_device_set_id(struct acpi_device *device)acpi_add_id (device,ACPI_DOCK_HID ); else if (!acpi_ibm_smbus_match(device)) acpi_add_id(device, ACPI_SMBUS_IBM_HID); - else if (!acpi_device_hid(device) && + else if (list_empty(&device->pnp.ids) && ACPI_IS_ROOT_DEVICE(device->parent)) {acpi_add_id (device,ACPI_BUS_HID );/* \_SB, LNXSYBUS */ strcpy (device->pnp.device_name,ACPI_BUS_DEVICE_NAME );
drivers/atm/solos-pci.c +3 -2
@@ -967,10 +967,11 @@ static uint32_t fpga_tx(struct solos_card *card)for (port =0 ; tx_pending; tx_pending >>=1 , port++) {if (tx_pending &1 ) {struct sk_buff *oldskb = card->tx_skb[port]; -if (oldskb) +if (oldskb) {pci_unmap_single (card->dev,SKB_CB (oldskb)->dma_addr, oldskb->len,PCI_DMA_TODEVICE ); - + card->tx_skb[port] =NULL ; + }spin_lock (&card->tx_queue_lock); skb =skb_dequeue (&card->tx_queue[port]);if (!skb)
drivers/bluetooth/ath3k.c +1 -0
@@ -65,6 +65,7 @@ static struct usb_device_id ath3k_table[] = { { USB_DEVICE(0x13d3, 0x3304) }, { USB_DEVICE(0x0930, 0x0215) }, { USB_DEVICE(0x0489, 0xE03D) }, + { USB_DEVICE(0x0489, 0xE027) },/* Atheros AR9285 Malbec with sflash firmware */ { USB_DEVICE(0x03F0, 0x311D) },
drivers/bluetooth/btusb.c +1 -0
@@ -130,6 +130,7 @@ static struct usb_device_id blacklist_table[] = { { USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE }, { USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE }, { USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE }, + { USB_DEVICE(0x0489, 0xe027), .driver_info = BTUSB_IGNORE }, /* Atheros AR9285 Malbec with sflash firmware */ { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
drivers/input/joystick/walkera0701.c +4 -3
@@ -196,6 +196,7 @@ static void walkera0701_close(struct input_dev *dev)struct walkera_dev *w =input_get_drvdata (dev);parport_disable_irq (w->parport); +hrtimer_cancel (&w->timer); }static int walkera0701_connect (struct walkera_dev *w,int parport)
@@ -224,6 +225,9 @@ static int walkera0701_connect(struct walkera_dev *w, int parport)if (parport_claim (w->pardevice)) goto init_err1; +hrtimer_init (&w->timer,CLOCK_MONOTONIC ,HRTIMER_MODE_REL ); + w->timer.function = timer_handler; + w->input_dev =input_allocate_device ();if (!w->input_dev) goto init_err2;
@@ -254,8 +258,6 @@ static int walkera0701_connect(struct walkera_dev *w, int parport)if (err) goto init_err3; -hrtimer_init (&w->timer,CLOCK_MONOTONIC ,HRTIMER_MODE_REL ); - w->timer.function = timer_handler;return 0 ; init_err3:
@@ -271,7 +273,6 @@ static int walkera0701_connect(struct walkera_dev *w, int parport)static void walkera0701_disconnect (struct walkera_dev *w) { -hrtimer_cancel (&w->timer);input_unregister_device (w->input_dev);parport_release (w->pardevice);parport_unregister_device (w->pardevice);
drivers/input/serio/i8042-x86ia64io.h +9 -0
@@ -900,6 +900,7 @@ static int __init i8042_platform_init(void)int retval;#ifdef CONFIG_X86 +u8 a20_on =0xdf ;/* Just return if pre-detection shows no i8042 controller exist */ if (!x86_platform.i8042_detect ())return -ENODEV ;
@@ -939,6 +940,14 @@ static int __init i8042_platform_init(void)if (dmi_check_system (i8042_dmi_dritek_table)) i8042_dritek = true; + +/* +* A20 was already enabled during early kernel init. But some buggy +* BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to +* resume from S3. So we do it here and hope that nothing breaks. +*/ +i8042_command (&a20_on,0x10d1 ); +i8042_command (NULL ,0x00ff );/* Null command for SMM firmware */ #endif /* CONFIG_X86 */ return retval;
drivers/net/bonding/bond_main.c +7 -0
@@ -1439,6 +1439,8 @@ static void bond_compute_features(struct bonding *bond)struct net_device *bond_dev = bond->dev;u32 vlan_features =BOND_VLAN_FEATURES ;unsigned short max_hard_header_len =ETH_HLEN ; +unsigned int gso_max_size =GSO_MAX_SIZE ; +u16 gso_max_segs =GSO_MAX_SEGS ;int i;read_lock (&bond->lock);
@@ -1452,11 +1454,16 @@ static void bond_compute_features(struct bonding *bond)if (slave->dev->hard_header_len > max_hard_header_len) max_hard_header_len = slave->dev->hard_header_len; + + gso_max_size =min (gso_max_size, slave->dev->gso_max_size); + gso_max_segs =min (gso_max_segs, slave->dev->gso_max_segs); } done: bond_dev->vlan_features = vlan_features; bond_dev->hard_header_len = max_hard_header_len; + bond_dev->gso_max_segs = gso_max_segs; +netif_set_gso_max_size (bond_dev, gso_max_size);read_unlock (&bond->lock);
drivers/net/bonding/bond_sysfs.c +2 -0
@@ -1524,6 +1524,7 @@ static ssize_t bonding_store_slaves_active(struct device *d, goto out; } +read_lock (&bond->lock);bond_for_each_slave (bond, slave, i) {if (!bond_is_active_slave (slave)) {if (new_value)
@@ -1532,6 +1533,7 @@ static ssize_t bonding_store_slaves_active(struct device *d, slave->inactive =1 ; } } +read_unlock (&bond->lock); out:return ret; }
drivers/net/can/dev.c +1 -2
@@ -557,8 +557,7 @@ void close_candev(struct net_device *dev) {struct can_priv *priv =netdev_priv (dev); -if (del_timer_sync (&priv->restart_timer)) -dev_put (dev); +del_timer_sync (&priv->restart_timer);can_flush_echo_skb (dev); }EXPORT_SYMBOL_GPL (close_candev);
drivers/net/irda/sir_dev.c +1 -1
@@ -221,7 +221,7 @@ static void sirdev_config_fsm(struct work_struct *work)break ;case SIRDEV_STATE_DONGLE_SPEED : -if (dev->dongle_drv->reset) { +if (dev->dongle_drv->set_speed) { ret = dev->dongle_drv->set_speed (dev, fsm->param);if (ret <0 ) { fsm->result = ret;
drivers/net/ne.c +1 -0
@@ -814,6 +814,7 @@ static int __init ne_drv_probe(struct platform_device *pdev) dev->irq = irq[this_dev]; dev->mem_end = bad[this_dev]; } +SET_NETDEV_DEV (dev, &pdev->dev); err =do_ne_probe (dev);if (err) {free_netdev (dev);
drivers/net/usb/ipheth.c +5 -0
@@ -62,6 +62,7 @@#define USB_PRODUCT_IPAD 0x129a#define USB_PRODUCT_IPHONE_4_VZW 0x129c#define USB_PRODUCT_IPHONE_4S 0x12a0 +#define USB_PRODUCT_IPHONE_5 0x12a8#define IPHETH_USBINTF_CLASS 255#define IPHETH_USBINTF_SUBCLASS 253
@@ -113,6 +114,10 @@ static struct usb_device_id ipheth_table[] = { USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4S,IPHETH_USBINTF_CLASS ,IPHETH_USBINTF_SUBCLASS , IPHETH_USBINTF_PROTO) }, + { USB_DEVICE_AND_INTERFACE_INFO( +USB_VENDOR_APPLE ,USB_PRODUCT_IPHONE_5 , +IPHETH_USBINTF_CLASS ,IPHETH_USBINTF_SUBCLASS , + IPHETH_USBINTF_PROTO) }, { } };MODULE_DEVICE_TABLE (usb, ipheth_table);
drivers/net/wireless/p54/p54usb.c +4 -0
@@ -46,6 +46,7 @@ static struct usb_device_id p54u_table[] = { {USB_DEVICE(0x0411, 0x0050)}, /* Buffalo WLI2-USB2-G54 */ {USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */ {USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */ + {USB_DEVICE(0x0675, 0x0530)}, /* DrayTek Vigor 530 */ {USB_DEVICE(0x06b9, 0x0120)}, /* Thomson SpeedTouch 120g */ {USB_DEVICE(0x0707, 0xee06)}, /* SMC 2862W-G */ {USB_DEVICE(0x07aa, 0x001c)}, /* Corega CG-WLUSB2GT */
@@ -81,6 +82,8 @@ static struct usb_device_id p54u_table[] = { {USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */ {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */ {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ + {USB_DEVICE(0x0803, 0x4310)}, /* Zoom 4410a */ + {USB_DEVICE(0x083a, 0x4503)}, /* T-Com Sinus 154 data II */ {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ {USB_DEVICE(0x083a, 0xc501)}, /* Zoom Wireless-G 4410 */ {USB_DEVICE(0x083a, 0xf503)}, /* Accton FD7050E ver 1010ec */
@@ -100,6 +103,7 @@ static struct usb_device_id p54u_table[] = { {USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */ {USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */ {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ +/* {USB_DEVICE(0x15a9, 0x0002)}, * Also SparkLAN WL-682 with 3887 */ {USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */ {USB_DEVICE(0x1740, 0x1000)}, /* Senao NUB-350 */ {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */
drivers/pci/quirks.c +5 -2
@@ -2746,7 +2746,7 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev)if (PCI_FUNC (dev->devfn))return ;/* -* RICOH 0xe823 SD/MMC card reader fails to recognize +* RICOH 0xe822 and 0xe823 SD/MMC card readers fail to recognize * certain types of SD/MMC cards. Lowering the SD base * clock frequency from 200Mhz to 50Mhz fixes this issue. *
@@ -2757,7 +2757,8 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev)* 0xf9 - Key register for 0x150 * 0xfc - key register for 0xe1 */ -if (dev->device ==PCI_DEVICE_ID_RICOH_R5CE823 ) { +if (dev->device ==PCI_DEVICE_ID_RICOH_R5CE822 || + dev->device ==PCI_DEVICE_ID_RICOH_R5CE823 ) {pci_write_config_byte (dev,0xf9 ,0xfc );pci_write_config_byte (dev,0x150 ,0x10 );pci_write_config_byte (dev,0xf9 ,0x00 );
@@ -2784,6 +2785,8 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev) }DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_RICOH ,PCI_DEVICE_ID_RICOH_R5C832 , ricoh_mmc_fixup_r5c832);DECLARE_PCI_FIXUP_RESUME_EARLY (PCI_VENDOR_ID_RICOH ,PCI_DEVICE_ID_RICOH_R5C832 , ricoh_mmc_fixup_r5c832); +DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_RICOH ,PCI_DEVICE_ID_RICOH_R5CE822 , ricoh_mmc_fixup_r5c832); +DECLARE_PCI_FIXUP_RESUME_EARLY (PCI_VENDOR_ID_RICOH ,PCI_DEVICE_ID_RICOH_R5CE822 , ricoh_mmc_fixup_r5c832);DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_RICOH ,PCI_DEVICE_ID_RICOH_R5CE823 , ricoh_mmc_fixup_r5c832);DECLARE_PCI_FIXUP_RESUME_EARLY (PCI_VENDOR_ID_RICOH ,PCI_DEVICE_ID_RICOH_R5CE823 , ricoh_mmc_fixup_r5c832);#endif /*CONFIG_MMC_RICOH_MMC*/
drivers/pnp/pnpacpi/core.c +1 -1
@@ -57,7 +57,7 @@ static inline int __init is_exclusive_device(struct acpi_device *dev)if (!(('0' <= (c ) && (c) <='9' ) || ('A' <= (c ) && (c) <='F' ))) \ return 0#define TEST_ALPHA (c) \ - if (!('@' <= (c) || (c) <= 'Z')) \ + if (!('A' <= (c) && (c) <= 'Z')) \ return 0static int __init ispnpidacpi (const char *id) {
drivers/rtc/rtc-vt8500.c +6 -5
@@ -69,7 +69,7 @@ | ALARM_SEC_BIT)#define VT8500_RTC_CR_ENABLE (1 << 0)/* Enable RTC */ -#define VT8500_RTC_CR_24H (1 << 1)/* 24h time format */ +#define VT8500_RTC_CR_12H (1 << 1)/* 12h time format */ #define VT8500_RTC_CR_SM_ENABLE (1 << 2)/* Enable periodic irqs */ #define VT8500_RTC_CR_SM_SEC (1 << 3)/* 0: 1Hz/60, 1: 1Hz */ #define VT8500_RTC_CR_CALIB (1 << 4)/* Enable calibration */
@@ -116,7 +116,7 @@ static int vt8500_rtc_read_time(struct device *dev, struct rtc_time *tm) tm->tm_min =bcd2bin ((time &TIME_MIN_MASK ) >>TIME_MIN_S ); tm->tm_hour =bcd2bin ((time &TIME_HOUR_MASK ) >>TIME_HOUR_S ); tm->tm_mday =bcd2bin (date &DATE_DAY_MASK ); - tm->tm_mon =bcd2bin ((date &DATE_MONTH_MASK ) >>DATE_MONTH_S ); + tm->tm_mon =bcd2bin ((date &DATE_MONTH_MASK ) >>DATE_MONTH_S ) -1 ; tm->tm_year =bcd2bin ((date &DATE_YEAR_MASK ) >>DATE_YEAR_S ) + ((date >>DATE_CENTURY_S ) &1 ?200 :100 ); tm->tm_wday = (time &TIME_DOW_MASK ) >>TIME_DOW_S ;
@@ -135,8 +135,9 @@ static int vt8500_rtc_set_time(struct device *dev, struct rtc_time *tm) }writel ((bin2bcd (tm->tm_year -100 ) <<DATE_YEAR_S ) - | (bin2bcd (tm->tm_mon) <<DATE_MONTH_S ) - | (bin2bcd (tm->tm_mday)), + | (bin2bcd (tm->tm_mon +1 ) <<DATE_MONTH_S ) + | (bin2bcd (tm->tm_mday)) + | ((tm->tm_year >=200 ) <<DATE_CENTURY_S ), vt8500_rtc->regbase +VT8500_RTC_DS );writel ((bin2bcd (tm->tm_wday) <<TIME_DOW_S ) | (bin2bcd(tm->tm_hour) << TIME_HOUR_S)
@@ -246,7 +247,7 @@ static int __devinit vt8500_rtc_probe(struct platform_device *pdev) }/* Enable RTC and set it to 24-hour mode */ -writel (VT8500_RTC_CR_ENABLE |VT8500_RTC_CR_24H , +writel (VT8500_RTC_CR_ENABLE , vt8500_rtc->regbase +VT8500_RTC_CR ); vt8500_rtc->rtc = rtc_device_register("vt8500-rtc", &pdev->dev,
drivers/usb/gadget/f_phonet.c +6 -2
@@ -541,7 +541,7 @@ int pn_bind(struct usb_configuration *c, struct usb_function *f) req =usb_ep_alloc_request (fp->out_ep,GFP_KERNEL );if (!req) - goto err; + goto err_req; req->complete = pn_rx_complete; fp->out_reqv[i] = req;
@@ -550,14 +550,18 @@ int pn_bind(struct usb_configuration *c, struct usb_function *f)/* Outgoing USB requests */ fp->in_req =usb_ep_alloc_request (fp->in_ep,GFP_KERNEL );if (!fp->in_req) - goto err; + goto err_req;INFO (cdev,"USB CDC Phonet function\n" );INFO (cdev,"using %s, OUT %s, IN %s\n" , cdev->gadget->name, fp->out_ep->name, fp->in_ep->name);return 0 ; +err_req: +for (i =0 ; i < phonet_rxq_size && fp->out_reqv[i]; i++) +usb_ep_free_request (fp->out_ep, fp->out_reqv[i]); err: +if (fp->out_ep) fp->out_ep->driver_data =NULL ;if (fp->in_ep)
drivers/usb/host/ehci-pci.c +2 -1
@@ -359,7 +359,8 @@ static bool usb_is_intel_switchable_ehci(struct pci_dev *pdev) pdev->vendor ==PCI_VENDOR_ID_INTEL && (pdev->device ==0x1E26 || pdev->device ==0x8C2D || - pdev->device ==0x8C26 ); + pdev->device ==0x8C26 || + pdev->device ==0x9C26 ); }static void ehci_enable_xhci_companion (void )
drivers/usb/host/pci-quirks.c +3 -1
@@ -721,6 +721,7 @@ static int handshake(void __iomem *ptr, u32 mask, u32 done, }#define PCI_DEVICE_ID_INTEL_LYNX_POINT_XHCI 0x8C31 +#define PCI_DEVICE_ID_INTEL_LYNX_POINT_LP_XHCI 0x9C31bool usb_is_intel_ppt_switchable_xhci (struct pci_dev *pdev) {
@@ -734,7 +735,8 @@ bool usb_is_intel_lpt_switchable_xhci(struct pci_dev *pdev) {return pdev->class ==PCI_CLASS_SERIAL_USB_XHCI && pdev->vendor ==PCI_VENDOR_ID_INTEL && - pdev->device ==PCI_DEVICE_ID_INTEL_LYNX_POINT_XHCI ; + (pdev->device ==PCI_DEVICE_ID_INTEL_LYNX_POINT_XHCI || + pdev->device ==PCI_DEVICE_ID_INTEL_LYNX_POINT_LP_XHCI ); }bool usb_is_intel_switchable_xhci (struct pci_dev *pdev)
drivers/virtio/virtio_ring.c +7 -0
@@ -120,6 +120,13 @@ static int vring_add_indirect(struct vring_virtqueue *vq,unsigned head;int i; +/* +* We require lowmem mappings for the descriptors because +* otherwise virt_to_phys will give us bogus addresses in the +* virtqueue. +*/ + gfp &= ~(__GFP_HIGHMEM | __GFP_HIGH); + desc =kmalloc ((out + in) *sizeof (struct vring_desc ), gfp);if (!desc)return -ENOMEM ;
fs/binfmt_misc.c +4 -1
@@ -176,7 +176,10 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs) goto _error; bprm->argc ++; - bprm->interp = iname;/* for binfmt_script */ +/* Update interp in case binfmt_script needs it. */ + retval =bprm_change_interp (iname, bprm); +if (retval <0 ) + goto _error; interp_file =open_exec (iname); retval =PTR_ERR (interp_file);
fs/binfmt_script.c +3 -1
@@ -82,7 +82,9 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs) retval =copy_strings_kernel (1 , &i_name, bprm);if (retval)return retval; bprm->argc++; - bprm->interp = interp; + retval =bprm_change_interp (interp, bprm); +if (retval <0 ) +return retval;/* * OK, now restart the process with the interpreter's dentry.
fs/exec.c +15 -0
@@ -1192,9 +1192,24 @@ void free_bprm(struct linux_binprm *bprm)mutex_unlock (¤t->signal->cred_guard_mutex);abort_creds (bprm->cred); } +/* If a binfmt changed the interp, free it. */ +if (bprm->interp != bprm->filename) +kfree (bprm->interp);kfree (bprm); } +int bprm_change_interp (char *interp,struct linux_binprm *bprm) +{ +/* If a binfmt changed the interp, free it first. */ +if (bprm->interp != bprm->filename) +kfree (bprm->interp); + bprm->interp =kstrdup (interp,GFP_KERNEL ); +if (!bprm->interp) +return -ENOMEM ; +return 0 ; +} +EXPORT_SYMBOL (bprm_change_interp); +/* * install the new credentials for this executable */
fs/nfs/client.c +1 -2
@@ -673,8 +673,7 @@ static int nfs_create_rpc_client(struct nfs_client *clp,*/ static void nfs_destroy_server (struct nfs_server *server) { -if (!(server->flags &NFS_MOUNT_LOCAL_FLOCK ) || - !(server->flags &NFS_MOUNT_LOCAL_FCNTL )) +if (server->nlm_host)nlmclnt_done (server->nlm_host); }
fs/nfs/dir.c +6 -5
@@ -1216,11 +1216,14 @@ static int nfs_dentry_delete(const struct dentry *dentry) } +/* Ensure that we revalidate inode->i_nlink */ static void nfs_drop_nlink (struct inode *inode) {spin_lock (&inode->i_lock); -if (inode->i_nlink >0 ) -drop_nlink (inode); +/* drop the inode if we're reasonably sure this is the last link */ +if (inode->i_nlink ==1 ) +clear_nlink (inode); +NFS_I (inode)->cache_validity |=NFS_INO_INVALID_ATTR ;spin_unlock (&inode->i_lock); }
@@ -1235,8 +1238,8 @@ static void nfs_dentry_iput(struct dentry *dentry, struct inode *inode)NFS_I (inode)->cache_validity |=NFS_INO_INVALID_DATA ;if (dentry->d_flags &DCACHE_NFSFS_RENAMED ) { -drop_nlink (inode);nfs_complete_unlink (dentry, inode); +nfs_drop_nlink (inode); }iput (inode); }
@@ -1788,10 +1791,8 @@ static int nfs_safe_remove(struct dentry *dentry)if (inode !=NULL ) {nfs_inode_return_delegation (inode); error =NFS_PROTO (dir)->remove (dir, &dentry->d_name); -/* The VFS may want to delete this inode */ if (error ==0 )nfs_drop_nlink (inode); -nfs_mark_for_revalidate (inode); }else error =NFS_PROTO (dir)->remove (dir, &dentry->d_name);if (error == -ENOENT )
fs/nfs/super.c +1 -1
@@ -1052,7 +1052,7 @@ static int nfs_get_option_str(substring_t args[], char **option) {kfree (*option); *option =match_strdup (args); -return !option; +return !*option; }static int nfs_get_option_ul (substring_t args[],unsigned long *option)
fs/nfsd/nfs4xdr.c +10 -1
@@ -2682,11 +2682,16 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr, len = maxcount; v =0 ;while (len >0 ) { - pn = resp->rqstp->rq_resused++; + pn = resp->rqstp->rq_resused; +if (!resp->rqstp->rq_respages[pn]) {/* ran out of pages */ + maxcount -= len; +break ; + } resp->rqstp->rq_vec[v].iov_base =page_address (resp->rqstp->rq_respages[pn]); resp->rqstp->rq_vec[v].iov_len = len <PAGE_SIZE ? len :PAGE_SIZE ; + resp->rqstp->rq_resused++; v++; len -=PAGE_SIZE ; }
@@ -2734,6 +2739,8 @@ nfsd4_encode_readlink(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsdreturn nfserr;if (resp->xbuf->page_len)return nfserr_resource; +if (!resp->rqstp->rq_respages[resp->rqstp->rq_resused]) +return nfserr_resource; page =page_address (resp->rqstp->rq_respages[resp->rqstp->rq_resused++]);
@@ -2783,6 +2790,8 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4return nfserr;if (resp->xbuf->page_len)return nfserr_resource; +if (!resp->rqstp->rq_respages[resp->rqstp->rq_resused]) +return nfserr_resource;RESERVE_SPACE (8 );/* verifier */ savep = p;
include/asm-generic/tlb.h +9 -0
@@ -78,6 +78,14 @@ struct mmu_gather_batch {#define MAX_GATHER_BATCH \ ((PAGE_SIZE - sizeof(struct mmu_gather_batch)) / sizeof(void *)) +/* +* Limit the maximum number of mmu_gather batches to reduce a risk of soft +* lockups for non-preemptible kernels on huge machines when a lot of memory +* is zapped during unmapping. +* 10K pages freed at once should be safe even without a preemption point. +*/ +#define MAX_GATHER_BATCH_COUNT (10000UL/MAX_GATHER_BATCH) +/* struct mmu_gather is an opaque type used by the mm code for passing around * any data needed by arch specific code for tlb_remove_page. */
@@ -94,6 +102,7 @@ struct mmu_gather {struct mmu_gather_batch *active;struct mmu_gather_batch local;struct page *__pages[MMU_GATHER_BUNDLE ]; +unsigned int batch_count; };#define HAVE_GENERIC_MMU_GATHER
include/linux/binfmts.h +1 -0
@@ -126,6 +126,7 @@ extern int setup_arg_pages(struct linux_binprm * bprm,unsigned long stack_top, int executable_stack);extern int bprm_mm_init (struct linux_binprm *bprm); +extern int bprm_change_interp (char *interp,struct linux_binprm *bprm);extern int copy_strings_kernel (int argc,const char *const *argv,struct linux_binprm *bprm);extern int prepare_bprm_creds (struct linux_binprm *bprm);
include/linux/compiler-gcc.h +5 -0
@@ -50,6 +50,11 @@# define inline inline __attribute__((always_inline))# define __inline__ __inline__ __attribute__((always_inline))# define __inline __inline __attribute__((always_inline)) +#else +/* A lot of inline functions can cause havoc with function tracing */ +# define inline inline notrace +# define __inline__ __inline__ notrace +# define __inline __inline notrace#endif #define __deprecated __attribute__((deprecated))
include/linux/page-flags.h +7 -1
@@ -365,7 +365,7 @@ static inline void ClearPageCompound(struct page *page)* pages on the LRU and/or pagecache. */ TESTPAGEFLAG(Compound, compound) -__PAGEFLAG (Head, compound) +__SETPAGEFLAG(Head, compound) __CLEARPAGEFLAG(Head, compound)/* * PG_reclaim is used in combination with PG_compound to mark the
@@ -377,8 +377,14 @@ __PAGEFLAG(Head, compound)* PG_compound & PG_reclaim => Tail page * PG_compound & ~PG_reclaim => Head page */ +#define PG_head_mask ((1L << PG_compound))#define PG_head_tail_mask ((1L << PG_compound) | (1L << PG_reclaim)) +static inline int PageHead (struct page *page) +{ +return ((page->flags & PG_head_tail_mask) == PG_head_mask); +} +static inline int PageTail (struct page *page) {return ((page->flags & PG_head_tail_mask) == PG_head_tail_mask);
include/linux/pci_ids.h +1 -0
@@ -1537,6 +1537,7 @@#define PCI_DEVICE_ID_RICOH_RL5C476 0x0476#define PCI_DEVICE_ID_RICOH_RL5C478 0x0478#define PCI_DEVICE_ID_RICOH_R5C822 0x0822 +#define PCI_DEVICE_ID_RICOH_R5CE822 0xe822#define PCI_DEVICE_ID_RICOH_R5CE823 0xe823#define PCI_DEVICE_ID_RICOH_R5C832 0x0832#define PCI_DEVICE_ID_RICOH_R5C843 0x0843
include/linux/snmp.h +2 -1
@@ -209,7 +209,6 @@ enumLINUX_MIB_TCPDSACKOFOSENT ,/* TCPDSACKOfoSent */ LINUX_MIB_TCPDSACKRECV ,/* TCPDSACKRecv */ LINUX_MIB_TCPDSACKOFORECV ,/* TCPDSACKOfoRecv */ -LINUX_MIB_TCPABORTONSYN ,/* TCPAbortOnSyn */ LINUX_MIB_TCPABORTONDATA ,/* TCPAbortOnData */ LINUX_MIB_TCPABORTONCLOSE ,/* TCPAbortOnClose */ LINUX_MIB_TCPABORTONMEMORY, /* TCPAbortOnMemory */
@@ -231,6 +230,8 @@ enumLINUX_MIB_TCPDEFERACCEPTDROP ,LINUX_MIB_IPRPFILTER ,/* IP Reverse Path Filter (rp_filter) */ LINUX_MIB_TCPTIMEWAITOVERFLOW ,/* TCPTimeWaitOverflow */ +LINUX_MIB_TCPCHALLENGEACK ,/* TCPChallengeACK */ +LINUX_MIB_TCPSYNCHALLENGE ,/* TCPSYNChallenge */ __LINUX_MIB_MAX };
include/net/tcp.h +1 -0
@@ -246,6 +246,7 @@ extern int sysctl_tcp_max_ssthresh;extern int sysctl_tcp_cookie_size;extern int sysctl_tcp_thin_linear_timeouts;extern int sysctl_tcp_thin_dupack; +extern int sysctl_tcp_challenge_ack_limit;extern atomic_long_t tcp_memory_allocated;extern struct percpu_counter tcp_sockets_allocated;
kernel/cgroup.c +0 -2
@@ -2630,9 +2630,7 @@ static int cgroup_create_dir(struct cgroup *cgrp, struct dentry *dentry, dentry->d_fsdata = cgrp;inc_nlink (parent->d_inode);rcu_assign_pointer (cgrp->dentry, dentry); -dget (dentry); } -dput (dentry);return error; }
kernel/irq/manage.c +21 -2
@@ -698,6 +698,7 @@ static void irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action) { cpumask_var_t mask; +bool valid = true;if (!test_and_clear_bit (IRQTF_AFFINITY , &action->thread_flags))return ;
@@ -712,10 +713,18 @@ irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action) }raw_spin_lock_irq (&desc->lock); -cpumask_copy (mask, desc->irq_data.affinity); +/* +* This code is triggered unconditionally. Check the affinity +* mask pointer. For CPU_MASK_OFFSTACK=n this is optimized out. +*/ +if (desc->irq_data.affinity) +cpumask_copy (mask, desc->irq_data.affinity); +else + valid = false;raw_spin_unlock_irq (&desc->lock); -set_cpus_allowed_ptr (current, mask); +if (valid) +set_cpus_allowed_ptr (current, mask);free_cpumask_var (mask); }#else
@@ -925,6 +934,16 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)*/ get_task_struct (t); new->thread = t; +/* +* Tell the thread to set its affinity. This is +* important for shared interrupt handlers as we do +* not invoke setup_affinity() for the secondary +* handlers as everything is already set up. Even for +* interrupts marked with IRQF_NO_BALANCE this is +* correct as we want the thread to move to the cpu(s) +* on which the requesting code placed the interrupt. +*/ +set_bit (IRQTF_AFFINITY , &new->thread_flags); }if (!alloc_cpumask_var (&mask,GFP_KERNEL )) {
mm/memory.c +5 -0
@@ -205,10 +205,14 @@ static int tlb_next_batch(struct mmu_gather *tlb)return 1 ; } +if (tlb->batch_count ==MAX_GATHER_BATCH_COUNT ) +return 0 ; + batch = (void *)__get_free_pages (GFP_NOWAIT | __GFP_NOWARN,0 );if (!batch)return 0 ; + tlb->batch_count++; batch->next =NULL ; batch->nr =0 ; batch->max =MAX_GATHER_BATCH ;
@@ -235,6 +239,7 @@ void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, bool fullmm) tlb->local.nr =0 ; tlb->local.max =ARRAY_SIZE (tlb->__pages); tlb->active = &tlb->local; + tlb->batch_count =0 ;#ifdef CONFIG_HAVE_RCU_TABLE_FREE tlb->batch =NULL ;
mm/mempolicy.c +26 -38
116 lines not on this page · raw message
net/bluetooth/hci_core.c +2 -0
@@ -1333,6 +1333,8 @@ int hci_unregister_dev(struct hci_dev *hdev)for (i =0 ; i <NUM_REASSEMBLY ; i++)kfree_skb (hdev->reassembly[i]); +cancel_work_sync (&hdev->power_on); +if (!test_bit (HCI_INIT , &hdev->flags) && !test_bit (HCI_SETUP , &hdev->flags))mgmt_index_removed (hdev->id);
net/ipv4/proc.c +2 -1
@@ -232,7 +232,6 @@ static const struct snmp_mib snmp4_net_list[] = {SNMP_MIB_ITEM ("TCPDSACKOfoSent" ,LINUX_MIB_TCPDSACKOFOSENT ),SNMP_MIB_ITEM ("TCPDSACKRecv" ,LINUX_MIB_TCPDSACKRECV ),SNMP_MIB_ITEM ("TCPDSACKOfoRecv" ,LINUX_MIB_TCPDSACKOFORECV ), -SNMP_MIB_ITEM ("TCPAbortOnSyn" ,LINUX_MIB_TCPABORTONSYN ),SNMP_MIB_ITEM ("TCPAbortOnData" ,LINUX_MIB_TCPABORTONDATA ),SNMP_MIB_ITEM ("TCPAbortOnClose" ,LINUX_MIB_TCPABORTONCLOSE ), SNMP_MIB_ITEM("TCPAbortOnMemory", LINUX_MIB_TCPABORTONMEMORY),
@@ -254,6 +253,8 @@ static const struct snmp_mib snmp4_net_list[] = {SNMP_MIB_ITEM ("TCPDeferAcceptDrop" ,LINUX_MIB_TCPDEFERACCEPTDROP ),SNMP_MIB_ITEM ("IPReversePathFilter" ,LINUX_MIB_IPRPFILTER ),SNMP_MIB_ITEM ("TCPTimeWaitOverflow" ,LINUX_MIB_TCPTIMEWAITOVERFLOW ), +SNMP_MIB_ITEM ("TCPChallengeACK" ,LINUX_MIB_TCPCHALLENGEACK ), +SNMP_MIB_ITEM ("TCPSYNChallenge" ,LINUX_MIB_TCPSYNCHALLENGE ), SNMP_MIB_SENTINEL };
net/ipv4/sysctl_net_ipv4.c +7 -0
@@ -566,6 +566,13 @@ static struct ctl_table ipv4_table[] = { .mode = 0644, .proc_handler = proc_dointvec }, + { + .procname = "tcp_challenge_ack_limit", + .data = &sysctl_tcp_challenge_ack_limit, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec + },#ifdef CONFIG_NET_DMA { .procname = "tcp_dma_copybreak",
net/ipv4/tcp_input.c +68 -25
177 lines not on this page · raw message
net/sched/sch_htb.c +1 -1
@@ -876,7 +876,7 @@ ok: q->now =psched_get_time (); start_at = jiffies; - next_event = q->now +5 *PSCHED_TICKS_PER_SEC ; + next_event = q->now +5LLU *PSCHED_TICKS_PER_SEC ;for (level =0 ; level <TC_HTB_MAXDEPTH ; level++) {/* common case optimization - skip event handler quickly */
net/sctp/chunk.c +14 -6
@@ -183,7 +183,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, msg =sctp_datamsg_new (GFP_KERNEL );if (!msg) -return NULL ; +return ERR_PTR (-ENOMEM );/* Note: Calculate this outside of the loop, so that all fragments * have the same expiration.
@@ -280,11 +280,14 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, chunk =sctp_make_datafrag_empty (asoc, sinfo, len, frag,0 ); -if (!chunk) +if (!chunk) { + err = -ENOMEM ; goto errout; + } + err =sctp_user_addto_chunk (chunk, offset, len, msgh->msg_iov);if (err <0 ) - goto errout; + goto errout_chunk_free; offset += len;
@@ -315,8 +318,10 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, chunk =sctp_make_datafrag_empty (asoc, sinfo, over, frag,0 ); -if (!chunk) +if (!chunk) { + err = -ENOMEM ; goto errout; + } err =sctp_user_addto_chunk (chunk, offset, over,msgh->msg_iov);
@@ -324,7 +329,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,__skb_pull (chunk->skb, (__u8 *)chunk->chunk_hdr - (__u8 *)chunk->skb->data);if (err <0 ) - goto errout; + goto errout_chunk_free;sctp_datamsg_assign (msg, chunk);list_add_tail (&chunk->frag_list, &msg->chunks);
@@ -332,6 +337,9 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,return msg; +errout_chunk_free: +sctp_chunk_free (chunk); + errout:list_for_each_safe (pos, temp, &msg->chunks) {list_del_init (pos);
@@ -339,7 +347,7 @@ errout:sctp_chunk_free (chunk); }sctp_datamsg_put (msg); -return NULL ; +return ERR_PTR (err); }/* Check whether this message has expired. */
net/sctp/socket.c +2 -2
@@ -1837,8 +1837,8 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,/* Break the message into multiple chunks of maximum size. */ datamsg =sctp_datamsg_from_user (asoc, sinfo, msg, msg_len); -if (!datamsg) { - err = -ENOMEM ; +if (IS_ERR (datamsg)) { + err =PTR_ERR (datamsg); goto out_free; }
sound/usb/midi.c +58 -33
198 lines not on this page · raw message