Linux 3.18.137
Greg KH
maintainerI'm announcing the release of the 3.18.137 kernel.
All users of the 3.18 kernel series must upgrade.
The updated 3.18.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.18.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
------------
Makefile | 2 arch/arm/mach-s3c24xx/mach-osiris-dvs.c | 8 +- arch/arm/plat-pxa/ssp.c | 3 - arch/arm64/kernel/head.S | 3 - arch/m68k/Makefile | 5 + arch/mips/configs/ath79_defconfig | 1 arch/mips/jazz/jazzdma.c | 5 + arch/powerpc/kernel/entry_32.S | 9 +++ arch/powerpc/platforms/83xx/suspend-asm.S | 34 +++++++++--- arch/powerpc/platforms/embedded6xx/wii.c | 4 + arch/powerpc/platforms/powernv/opal-msglog.c | 2 arch/x86/kernel/kexec-bzimage64.c | 3 + arch/x86/kvm/svm.c | 8 ++ arch/xtensa/configs/smp_lx200_defconfig | 1 arch/xtensa/kernel/head.S | 5 + arch/xtensa/kernel/smp.c | 41 +++++++++----- crypto/ahash.c | 14 ++--- crypto/pcbc.c | 14 +---- drivers/atm/he.c | 2 drivers/cpufreq/pxa2xx-cpufreq.c | 4 - drivers/dma/dmatest.c | 28 ++++------ drivers/firmware/iscsi_ibft.c | 1 drivers/gpu/drm/msm/msm_rd.c | 7 ++ drivers/gpu/drm/radeon/evergreen_cs.c | 1 drivers/i2c/busses/i2c-cadence.c | 9 ++- drivers/input/keyboard/matrix_keypad.c | 2 drivers/input/keyboard/st-keyscan.c | 4 - drivers/input/tablet/wacom_serial4.c | 2 drivers/iommu/amd_iommu.c | 15 +++-- drivers/irqchip/irq-mmp.c | 6 +- drivers/isdn/hardware/avm/b1.c | 2 drivers/isdn/i4l/isdn_tty.c | 6 +- drivers/leds/leds-lp5523.c | 4 + drivers/md/raid10.c | 3 - drivers/md/raid5.c | 2 drivers/media/usb/uvc/uvc_driver.c | 14 +++-- drivers/media/usb/uvc/uvc_video.c | 8 ++ drivers/mfd/ab8500-core.c | 2 drivers/mfd/db8500-prcmu.c | 4 - drivers/mfd/mc13xxx-core.c | 4 + drivers/mfd/ti_am335x_tscadc.c | 5 + drivers/mfd/twl-core.c | 4 - drivers/mfd/wm5110-tables.c | 2 drivers/mmc/host/mmc_spi.c | 1 drivers/net/ethernet/altera/altera_msgdma.c | 3 - drivers/net/ethernet/altera/altera_tse_main.c | 4 + drivers/net/ethernet/atheros/atlx/atl2.c | 4 - drivers/net/ethernet/broadcom/bcmsysport.c | 4 + drivers/net/ethernet/ibm/ibmveth.c | 2 drivers/net/ethernet/marvell/mv643xx_eth.c | 7 ++ drivers/net/ethernet/marvell/sky2.c | 24 ++++++++ drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 6 +- drivers/net/phy/mdio_bus.c | 1 drivers/net/phy/micrel.c | 14 ++++- drivers/net/ppp/pptp.c | 1 drivers/net/team/team.c | 27 +-------- drivers/net/team/team_mode_loadbalance.c | 15 +++++ drivers/net/vxlan.c | 10 +++ drivers/parport/parport_pc.c | 2 drivers/platform/x86/Kconfig | 1 drivers/regulator/s2mpa01.c | 10 +-- drivers/regulator/s2mps11.c | 6 +- drivers/s390/block/dasd_eckd.c | 8 ++ drivers/s390/net/qeth_core_main.c | 15 ++--- drivers/scsi/csiostor/csio_attr.c | 2 drivers/scsi/isci/init.c | 14 ++--- drivers/scsi/libfc/fc_lport.c | 6 +- drivers/scsi/libiscsi.c | 6 ++ drivers/scsi/libsas/sas_expander.c | 2 drivers/scsi/qla4xxx/ql4_os.c | 2 drivers/scsi/virtio_scsi.c | 2 drivers/target/iscsi/iscsi_target.c | 4 - drivers/tty/serial/fsl_lpuart.c | 2 drivers/usb/dwc3/gadget.c | 1 drivers/usb/gadget/function/f_sourcesink.c | 2 drivers/usb/serial/cp210x.c | 1 fs/autofs4/expire.c | 3 - fs/autofs4/inode.c | 4 + fs/btrfs/extent_io.c | 4 - fs/ceph/snap.c | 3 - fs/cifs/file.c | 12 ++-- fs/cifs/smb2pdu.h | 4 - fs/ext2/super.c | 39 +++++++++----- fs/ext4/resize.c | 3 - fs/hugetlbfs/inode.c | 12 ++++ fs/jbd2/transaction.c | 17 ++++-- fs/nfs/super.c | 5 + fs/nfsd/nfs3proc.c | 16 +++++ fs/nfsd/nfs3xdr.c | 1 fs/nfsd/nfsctl.c | 2 include/keys/user-type.h | 2 include/net/gro_cells.h | 12 +++- include/net/icmp.h | 9 ++- include/net/ip.h | 2 kernel/sysctl.c | 11 +++ lib/assoc_array.c | 8 +- mm/hugetlb.c | 14 ++++- mm/memory_hotplug.c | 3 - mm/mempolicy.c | 6 +- mm/migrate.c | 11 +++ mm/mmap.c | 7 +- mm/shmem.c | 12 ++-- mm/vmalloc.c | 2 net/9p/client.c | 2 net/batman-adv/soft-interface.c | 2 net/ceph/messenger.c | 12 ++-- net/core/net-sysfs.c | 3 + net/hsr/hsr_device.c | 18 +++--- net/hsr/hsr_framereg.c | 12 ++++ net/hsr/hsr_framereg.h | 1 net/ipv4/cipso_ipv4.c | 23 ++++++-- net/ipv4/icmp.c | 7 +- net/ipv4/ip_options.c | 22 ++++++- net/ipv4/ip_vti.c | 50 ++++++++++++++++++ net/ipv6/ip6mr.c | 8 +- net/ipv6/route.c | 2 net/ipv6/sit.c | 7 +- net/l2tp/l2tp_ip6.c | 4 - net/mac80211/cfg.c | 4 + net/mac80211/rx.c | 4 + net/netfilter/ipvs/ip_vs_ctl.c | 12 ++++ net/netlink/af_netlink.c | 34 +++++++----- net/nfc/llcp_commands.c | 20 +++++++ net/nfc/llcp_core.c | 24 +++++++- net/packet/af_packet.c | 2 net/unix/af_unix.c | 48 ++++++++++------- net/unix/diag.c | 3 - net/wireless/reg.c | 4 - net/x25/af_x25.c | 20 +++++-- security/keys/key.c | 4 - security/keys/keyring.c | 4 - security/keys/proc.c | 3 - security/keys/request_key.c | 1 security/keys/request_key_auth.c | 2 security/lsm_audit.c | 10 ++- sound/core/compress_offload.c | 3 - sound/firewire/bebob/bebob.c | 14 ++++- sound/soc/fsl/fsl_esai.c | 7 +- sound/soc/fsl/imx-audmux.c | 24 ++++---- sound/soc/intel/broadwell.c | 2 sound/soc/intel/haswell.c | 2 tools/perf/util/cpumap.c | 11 +++ tools/perf/util/symbol-elf.c | 9 ++- 143 files changed, 836 insertions(+), 344 deletions(-)
Aditya Pakki (1):
md: Fix failed allocation of md_register_thread
Al Viro (1):
missing barriers in some of unix_sock ->addr and ->path accesses
Alban Bedel (1):
MIPS: ath79: Enable OF serial ports in the default config
Alexey Khoroshilov (1):
net: mv643xx_eth: disable clk on error path in mv643xx_eth_shared_probe()
Alistair Strachan (1):
media: uvcvideo: Fix 'type' check leading to overflow
Andy Shevchenko (1):
dmaengine: dmatest: Abort test in case of mapping error
Anoob Soman (1):
scsi: libiscsi: Fix race between iscsi_xmit_task and iscsi_complete_task
Arad, Ronen (1):
netlink: Trim skb to alloc size to avoid MSG_TRUNC
Arnd Bergmann (1):
cpufreq: pxa2xx: remove incorrect __init annotation
Atsushi Nemoto (1):
net: altera_tse: fix connect_local_phy error path
Balaji Pothunoori (1):
mac80211: don't initiate TDLS connection if station is not associated to AP
Bart Van Assche (1):
scsi: target/iscsi: Avoid iscsit_release_commands_from_conn() deadlock
Bob Copeland (1):
mac80211: fix miscounting of ttl-dropped frames
Chaitanya Tata (1):
cfg80211: extend range deviation for DMG
Charles Keepax (1):
mfd: wm5110: Add missing ASRC rate register
Christophe Leroy (3):
powerpc/32: Clear on-stack exception marker upon exception return powerpc/wii: properly disable use of BATs when requested. powerpc/83xx: Also save/restore SPRG4-7 during suspend
Colin Ian King (1):
atm: he: fix sign-extension overflow on large shift
Cong Wang (1):
team: avoid complex list operations in team_nl_cmd_options_set()
Dan Carpenter (3):
mfd: ab8500-core: Return zero in get_register_interruptible()
ALSA: compress: prevent potential divide by zero bugs
usb: gadget: Potential NULL dereference on allocation error
Darrick J. Wong (2):
tmpfs: fix link accounting when a tmpfile is linked in
tmpfs: fix uninitialized return value in shmem_link
David Howells (1):
assoc_array: Fix shortcut creation
Dmitry Torokhov (1):
Input: matrix_keypad - use flush_delayed_work()
Eric Biggers (5):
KEYS: allow reaching the keys quotas exactly
KEYS: user: Align the payload buffer
KEYS: always initialize keyring_index_key::desc_len
crypto: ahash - fix another early termination in hash walk
crypto: pcbc - remove bogus memcpy()s with src == dest
Eric Dumazet (8):
batman-adv: fix uninit-value in batadv_interface_tx()
l2tp: fix infoleak in l2tp_ip6_recvmsg()
net/x25: fix use-after-free in x25_device_event() net/x25: reset state in x25_connect()
net/x25: fix a race in x25_bind()
vxlan: test dev->flags & IFF_UP before calling gro_cells_receive() net/hsr: fix possible crash in add_timer()
gro_cells: make sure device is up in gro_cells_receive()
Felipe Franciosi (1):
scsi: virtio_scsi: don't send sc payload with tmfs
Filipe Manana (1):
Btrfs: fix corruption reading shared and compressed extents after hole punching
Finn Thain (1):
m68k: Add -ffreestanding to CFLAGS
Florian Fainelli (1):
net: systemport: Fix reception of BPDUs
Gabriel Fernandez (1):
Input: st-keyscan - fix potential zalloc NULL dereference
Greg Kroah-Hartman (1):
Linux 3.18.137
Gustavo A. R. Silva (3):
iscsi_ibft: Fix missing break in switch statement
ARM: s3c24xx: Fix boolean expressions in osiris_dvs_notify drm/radeon/evergreen_cs: fix missing break in switch statement
Hangbin Liu (1):
sit: check if IPv6 enabled before calling ip6_err_gen_icmpv6_unreach()
Ian Kent (1):
autofs: fix error return in autofs_fill_super()
Ido Schimmel (2):
team: Free BPF filter when unregistering netdev
ip6mr: Do not call __IP6_INC_STATS() from preemptible context
Ilya Dryomov (1):
libceph: handle an empty authorize reply
Ivan Mironov (1):
USB: serial: cp210x: add ID for Ingenico 3070
Jack Morgenstein (1):
net/mlx4_core: Fix qp mtt size calculation
Jan Kara (2):
ext4: fix crash during online resizing
ext2: Fix underflow in ext2_max_size()
Jann Horn (1):
mm: enforce min addr even if capable() in expand_downwards()
Jason Gerecke (1):
Input: wacom_serial4 - add support for Wacom ArtPad II tablet
Jia-Ju Bai (1):
isdn: i4l: isdn_tty: Fix some concurrency double-free bugs
Jiri Olsa (1):
perf symbols: Filter out hidden symbols from labels
John Garry (1):
scsi: libsas: Fix rphy phy_identifier for PHYs with end devices attached
Jonathan Neuschäfer (1):
mmc: spi: Fix card detection during probe
Jordan Niethe (1):
powerpc/powernv: Make opal log only readable by root
Julian Wiedmann (1):
s390/qeth: fix use-after-free in error path
Kai-Heng Feng (1):
sky2: Disable MSI on Dell Inspiron 1545 and Gateway P-79
Kairui Song (1):
x86/kexec: Don't setup EFI info if EFI runtime is not enabled
Kal Conley (1):
net/packet: fix 4gb buffer limit due to overflow check
Kalash Nainwal (1):
net: Set rtm_table to RT_TABLE_COMPAT for ipv6 for tables > 255
Kangjie Lu (2):
mfd: mc13xxx: Fix a missing check of a register-read failure
leds: lp5523: fix a missing check of return value of lp55xx_read
Kristian H. Kristensen (1):
drm/msm: Unblock writer if reader closes file
Krzysztof Kozlowski (1):
regulator: s2mps11: Fix steps for buck7, buck8 and LDO35
Logan Gunthorpe (1):
scsi: isci: initialize shost fully before calling scsi_add_host()
Lubomir Rintel (1):
irqchip/mmp: Only touch the PJ4 IRQ & FIQ bits on enable/disable
Mao Wenan (2):
net: hsr: fix memory leak in hsr_dev_finalize()
net: set static variable an initial value in atl2_probe()
Max Filippov (4):
xtensa: SMP: fix secondary CPU initialization
xtensa: smp_lx200_defconfig: fix vectors clash
xtensa: SMP: mark each possible CPU as present
xtensa: SMP: limit number of possible CPUs by NR_CPUS
Miaohe Lin (1):
net: sit: fix UBSAN Undefined behaviour in check_6rd
Michal Hocko (1):
mm, memory_hotplug: is_mem_section_removable do not pass the end of a zone
Mike Kravetz (1):
hugetlbfs: fix races and page leaks during migration
Ming Lu (1):
scsi: libfc: free skb when receiving invalid flogi resp
Nathan Chancellor (3):
mfd: twl-core: Fix section annotations on {,un}protect_pm_master
mfd: db8500-prcmu: Fix some section annotations
isdn: avm: Fix string plus integer warning from Clang
Nazarov Sergey (2):
net: Add __icmp_send helper.
net: avoid use IPCB in cipso_v4_error
NeilBrown (1):
nfsd: fix memory corruption caused by readdir
Pan Bian (1):
autofs: drop dentry reference only when it is never used
Paul Moore (1):
netlabel: fix out-of-bounds memory accesses
Pavel Shilovsky (1):
CIFS: Fix read after write for files with read caching
Peng Hao (1):
ARM: pxa: ssp: unneeded to free devm_ allocated data
QiaoChong (1):
parport_pc: fix find_superio io compare code, should use equal test.
Rajasingh Thavamani (1):
net: phy: Micrel KSZ8061: link failure after cable connect
Ralph Campbell (1):
numa: change get_mempolicy() to use nr_node_ids instead of MAX_NUMNODES
Rander Wang (1):
ASoC: Intel: Haswell/Broadwell: fix setting for .dynamic field
Roman Penyaev (1):
mm/vmalloc: fix size check for remap_vmalloc_range_partial()
Ronnie Sahlberg (1):
cifs: fix computation for MAX_SMB2_HDR_SIZE
S.j. Wang (1):
ASoC: fsl_esai: fix register setting issue in RIGHT_J mode
Sakari Ailus (1):
media: uvcvideo: Avoid NULL pointer dereference at the end of streaming
Shubhrajyoti Datta (1):
i2c: cadence: Fix the hold bit setting
Silvio Cesare (1):
ASoC: imx-audmux: change snprintf to scnprintf for possible overflow
Sinan Kaya (1):
platform/x86: Fix unmet dependency warning for SAMSUNG_Q10
Stefan Haberland (1):
s390/dasd: fix using offset into zero size array error
Stephane Eranian (1):
perf tools: Handle TOPOLOGY headers with no CPU
Stuart Menefy (1):
regulator: s2mpa01: Fix step values for some LDOs
Su Yanjun (1):
vti4: Fix a ipip packet processing bug in 'IPCOMP' virtual tunnel
Suravee Suthikulpanit (1):
iommu/amd: Fix IOMMU page flush when detach device from a domain
Takashi Sakamoto (1):
ALSA: bebob: use more identical mod_alias for Saffire Pro 10 I/O against Liquid Saffire 56
Thomas Bogendoerfer (1):
MIPS: jazz: fix 64bit build
Thomas Falcon (1):
ibmveth: Do not process frames after calling napi_reschedule
Tomonori Sakita (2):
serial: fsl_lpuart: fix maximum acceptable baud rate with over-sampling
net: altera_tse: fix msgdma_tx_completion on non-zero fill_level case
Varun Prakash (1):
scsi: csiostor: fix NULL pointer dereference in csio_vport_set_state()
Vignesh R (1):
mfd: ti_am335x_tscadc: Use PLATFORM_DEVID_AUTO while registering mfd cells
Vitaly Kuznetsov (1):
KVM: nSVM: clear events pending from svm_complete_interrupts() when exiting to L1
Vladimir Murzin (1):
arm64: Relax GIC version check during early boot
Xiao Ni (1):
It's wrong to add len to sector_nr in raid10 reshape twice
Xin Long (1):
pptp: dst_release sk_dst_cache in pptp_sock_destruct
Yan, Zheng (1):
ceph: avoid repeatedly adding inode to mdsc->snap_flush_list
Yao Liu (1):
nfs: Fix NULL pointer dereference of dev_name
Yihao Wu (1):
nfsd: fix wrong check in write_v4_end_grace()
YueHaibing (4):
scsi: qla4xxx: check return code of qla4xxx_copy_from_fwddb_param
net-sysfs: Fix mem leak in netdev_register_kobject
net: nfc: Fix NULL dereference on nfc_llcp_build_tlv fails
mdio_bus: Fix use-after-free on device_register fails
Zeng Tao (1):
usb: dwc3: gadget: Fix the uninitialized link_state when udc starts
Zev Weiss (1):
kernel/sysctl.c: add missing range check in do_proc_dointvec_minmax_conv
ZhangXiaoxu (1):
ipvs: Fix signed integer overflow when setsockopt timeout
zhangyi (F) (1):
jbd2: clear dirty flag when revoking a buffer from an older transaction
zhengbin (1):
9p/net: fix memory leak in p9_client_create
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 18 -SUBLEVEL = 136 +SUBLEVEL = 137 EXTRAVERSION = NAME = Diseased Newt
arch/arm/mach-s3c24xx/mach-osiris-dvs.c +4 -4
@@ -70,16 +70,16 @@ static int osiris_dvs_notify(struct notifier_block *nb,switch (val) {case CPUFREQ_PRECHANGE : -if (old_dvs & !new_dvs || - cur_dvs & !new_dvs) { +if ((old_dvs && !new_dvs) || + (cur_dvs && !new_dvs)) {pr_debug ("%s: exiting dvs\n" , __func__); cur_dvs = false;gpio_set_value (OSIRIS_GPIO_DVS ,1 ); }break ;case CPUFREQ_POSTCHANGE : -if (!old_dvs & new_dvs || - !cur_dvs & new_dvs) { +if ((!old_dvs && new_dvs) || + (!cur_dvs && new_dvs)) {pr_debug ("entering dvs\n" ); cur_dvs = true;gpio_set_value (OSIRIS_GPIO_DVS ,0 );
arch/arm/plat-pxa/ssp.c +0 -3
@@ -239,8 +239,6 @@ static int pxa_ssp_remove(struct platform_device *pdev)if (ssp ==NULL )return -ENODEV ; -iounmap (ssp->mmio_base); - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 );release_mem_region (res->start,resource_size (res));
@@ -250,7 +248,6 @@ static int pxa_ssp_remove(struct platform_device *pdev)list_del (&ssp->node);mutex_unlock (&ssp_lock); -kfree (ssp);return 0 ; }
arch/arm64/kernel/head.S +1 -2
@@ -295,8 +295,7 @@ CPU_LE( bic x0, x0, #(3 << 24) ) // Clear the EE and E0E bits for EL1 /* GICv3 system register access */ mrs x0, id_aa64pfr0_el1 ubfx x0, x0, #24, #4 - cmp x0, #1 - b.ne 3f + cbz x0, 3f mrs_s x0, ICC_SRE_EL2 orr x0, x0, #ICC_SRE_EL2_SRE // Set ICC_SRE_EL2.SRE==1
arch/m68k/Makefile +4 -1
@@ -59,7 +59,10 @@ cpuflags-$(CONFIG_M5206e) := $(call cc-option,-mcpu=5206e,-m5200) cpuflags-$(CONFIG_M5206) := $(call cc-option,-mcpu=5206,-m5200) KBUILD_AFLAGS += $(cpuflags-y) -KBUILD_CFLAGS += $(cpuflags-y) -pipe +KBUILD_CFLAGS += $(cpuflags-y) + +KBUILD_CFLAGS += -pipe -ffreestanding + ifdef CONFIG_MMU # without -fno-strength-reduce the 53c7xx.c driver fails ;-( KBUILD_CFLAGS += -fno-strength-reduce -ffixed-a2
arch/mips/configs/ath79_defconfig +1 -0
@@ -74,6 +74,7 @@ CONFIG_SERIAL_8250_CONSOLE=y # CONFIG_SERIAL_8250_PCI is not set CONFIG_SERIAL_8250_NR_UARTS=1 CONFIG_SERIAL_8250_RUNTIME_UARTS=1 +CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SERIAL_AR933X=y CONFIG_SERIAL_AR933X_CONSOLE=y # CONFIG_HW_RANDOM is not set
arch/mips/jazz/jazzdma.c +3 -2
@@ -71,14 +71,15 @@ static int __init vdma_init(void) get_order(VDMA_PGTBL_SIZE));BUG_ON (!pgtbl);dma_cache_wback_inv ((unsigned long )pgtbl,VDMA_PGTBL_SIZE ); - pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR (pgtbl); + pgtbl = (VDMA_PGTBL_ENTRY *)CKSEG1ADDR ((unsigned long )pgtbl);/* * Clear the R4030 translation table */ vdma_pgtbl_init (); -r4030_write_reg32 (JAZZ_R4030_TRSTBL_BASE ,CPHYSADDR (pgtbl)); +r4030_write_reg32 (JAZZ_R4030_TRSTBL_BASE , +CPHYSADDR ((unsigned long )pgtbl));r4030_write_reg32 (JAZZ_R4030_TRSTBL_LIM ,VDMA_PGTBL_SIZE );r4030_write_reg32 (JAZZ_R4030_TRSTBL_INV ,0 );
arch/powerpc/kernel/entry_32.S +9 -0
@@ -757,6 +757,9 @@ fast_exception_return: mtcr r10 lwz r10,_LINK(r11) mtlr r10 + /* Clear the exception_marker on the stack to avoid confusing stacktrace */ + li r10, 0 + stw r10, 8(r11) REST_GPR(10, r11) mtspr SPRN_SRR1,r9 mtspr SPRN_SRR0,r12
@@ -987,6 +990,9 @@ END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX) mtcrf 0xFF,r10 mtlr r11 + /* Clear the exception_marker on the stack to avoid confusing stacktrace */ + li r10, 0 + stw r10, 8(r1) /* * Once we put values in SRR0 and SRR1, we are in a state * where exceptions are not recoverable, since taking an
@@ -1024,6 +1030,9 @@ exc_exit_restart_end: mtlr r11 lwz r10,_CCR(r1) mtcrf 0xff,r10 + /* Clear the exception_marker on the stack to avoid confusing stacktrace */ + li r10, 0 + stw r10, 8(r1) REST_2GPRS(9, r1) .globl exc_exit_restart exc_exit_restart:
arch/powerpc/platforms/83xx/suspend-asm.S +27 -7
@@ -26,13 +26,13 @@ #define SS_MSR 0x74 #define SS_SDR1 0x78 #define SS_LR 0x7c -#define SS_SPRG 0x80 /* 4 SPRGs */ -#define SS_DBAT 0x90 /* 8 DBATs */ -#define SS_IBAT 0xd0 /* 8 IBATs */ -#define SS_TB 0x110 -#define SS_CR 0x118 -#define SS_GPREG 0x11c /* r12-r31 */ -#define STATE_SAVE_SIZE 0x16c +#define SS_SPRG 0x80 /* 8 SPRGs */ +#define SS_DBAT 0xa0 /* 8 DBATs */ +#define SS_IBAT 0xe0 /* 8 IBATs */ +#define SS_TB 0x120 +#define SS_CR 0x128 +#define SS_GPREG 0x12c /* r12-r31 */ +#define STATE_SAVE_SIZE 0x17c .section .data .align 5
@@ -103,6 +103,16 @@ _GLOBAL(mpc83xx_enter_deep_sleep) stw r7, SS_SPRG+12(r3) stw r8, SS_SDR1(r3) + mfspr r4, SPRN_SPRG4 + mfspr r5, SPRN_SPRG5 + mfspr r6, SPRN_SPRG6 + mfspr r7, SPRN_SPRG7 + + stw r4, SS_SPRG+16(r3) + stw r5, SS_SPRG+20(r3) + stw r6, SS_SPRG+24(r3) + stw r7, SS_SPRG+28(r3) + mfspr r4, SPRN_DBAT0U mfspr r5, SPRN_DBAT0L mfspr r6, SPRN_DBAT1U
@@ -493,6 +503,16 @@ mpc83xx_deep_resume: mtspr SPRN_IBAT7U, r6 mtspr SPRN_IBAT7L, r7 + lwz r4, SS_SPRG+16(r3) + lwz r5, SS_SPRG+20(r3) + lwz r6, SS_SPRG+24(r3) + lwz r7, SS_SPRG+28(r3) + + mtspr SPRN_SPRG4, r4 + mtspr SPRN_SPRG5, r5 + mtspr SPRN_SPRG6, r6 + mtspr SPRN_SPRG7, r7 + lwz r4, SS_SPRG+0(r3) lwz r5, SS_SPRG+4(r3) lwz r6, SS_SPRG+8(r3)
arch/powerpc/platforms/embedded6xx/wii.c +4 -0
@@ -104,6 +104,10 @@ unsigned long __init wii_mmu_mapin_mem2(unsigned long top)/* MEM2 64MB@0x10000000 */ delta = wii_hole_start + wii_hole_size; size = top - delta; + +if (__map_without_bats) +return delta; +for (bl =128 <<10 ; bl < max_size; bl <<=1 ) {if (bl *2 > size)break ;
arch/powerpc/platforms/powernv/opal-msglog.c +1 -1
@@ -92,7 +92,7 @@ out: }static struct bin_attribute opal_msglog_attr = { - .attr = {.name ="msglog" , .mode =0444 }, + .attr = {.name ="msglog" , .mode =0400 }, .read = opal_msglog_read };
arch/x86/kernel/kexec-bzimage64.c +3 -0
@@ -167,6 +167,9 @@ setup_efi_state(struct boot_params *params, unsigned long params_load_addr,struct efi_info *current_ei = &boot_params.efi_info;struct efi_info *ei = ¶ms->efi_info; +if (!efi_enabled (EFI_RUNTIME_SERVICES )) +return 0 ; +if (!current_ei->efi_memmap_size)return 0 ;
arch/x86/kvm/svm.c +8 -0
@@ -2431,6 +2431,14 @@ static int nested_svm_vmexit(struct vcpu_svm *svm)kvm_mmu_reset_context (&svm->vcpu);kvm_mmu_load (&svm->vcpu); +/* +* Drop what we picked up for L2 via svm_complete_interrupts() so it +* doesn't end up in L1. +*/ + svm->vcpu.arch.nmi_injected = false; +kvm_clear_exception_queue (&svm->vcpu); +kvm_clear_interrupt_queue (&svm->vcpu); +return 0 ; }
arch/xtensa/configs/smp_lx200_defconfig +1 -0
@@ -35,6 +35,7 @@ CONFIG_SMP=y CONFIG_HOTPLUG_CPU=y # CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX is not set # CONFIG_PCI is not set +CONFIG_VECTORS_OFFSET=0x00002000 CONFIG_XTENSA_PLATFORM_XTFPGA=y CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="earlycon=uart8250,mmio32,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug"
arch/xtensa/kernel/head.S +4 -1
@@ -281,12 +281,13 @@ should_never_return: movi a2, cpu_start_ccount 1: + memw l32i a3, a2, 0 beqi a3, 0, 1b movi a3, 0 s32i a3, a2, 0 - memw 1: + memw l32i a3, a2, 0 beqi a3, 0, 1b wsr a3, ccount
@@ -323,11 +324,13 @@ ENTRY(cpu_restart) rsr a0, prid neg a2, a0 movi a3, cpu_start_id + memw s32i a2, a3, 0 #if XCHAL_DCACHE_IS_WRITEBACK dhwbi a3, 0 #endif 1: + memw l32i a2, a3, 0 dhi a3, 0 bne a2, a0, 1b
arch/xtensa/kernel/smp.c +27 -14
81 lines not on this page · raw message
crypto/ahash.c +7 -7
@@ -84,17 +84,17 @@ static int hash_walk_new_entry(struct crypto_hash_walk *walk)int crypto_hash_walk_done (struct crypto_hash_walk *walk,int err) {unsigned int alignmask = walk->alignmask; -unsigned int nbytes = walk->entrylen; walk->data -= walk->offset; -if (nbytes && walk->offset & alignmask && !err) { - walk->offset =ALIGN (walk->offset, alignmask +1 ); - nbytes =min (nbytes, - ((unsigned int )(PAGE_SIZE )) - walk->offset); - walk->entrylen -= nbytes; +if (walk->entrylen && (walk->offset & alignmask) && !err) { +unsigned int nbytes; + walk->offset =ALIGN (walk->offset, alignmask +1 ); + nbytes =min (walk->entrylen, + (unsigned int )(PAGE_SIZE - walk->offset));if (nbytes) { + walk->entrylen -= nbytes; walk->data += walk->offset;return nbytes; }
@@ -114,7 +114,7 @@ int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err)if (err)return err; -if (nbytes) { +if (walk->entrylen) { walk->offset =0 ; walk->pg++;return hash_walk_next (walk);
crypto/pcbc.c +4 -10
@@ -52,7 +52,7 @@ static int crypto_pcbc_encrypt_segment(struct blkcipher_desc *desc,unsigned int nbytes = walk->nbytes;u8 *src = walk->src.virt.addr;u8 *dst = walk->dst.virt.addr; -u8 *iv = walk->iv; +u8 *const iv = walk->iv; do { crypto_xor(iv, src, bsize);
@@ -76,7 +76,7 @@ static int crypto_pcbc_encrypt_inplace(struct blkcipher_desc *desc,int bsize =crypto_cipher_blocksize (tfm);unsigned int nbytes = walk->nbytes;u8 *src = walk->src.virt.addr; -u8 *iv = walk->iv; +u8 *const iv = walk->iv;u8 tmpbuf[bsize]; do {
@@ -89,8 +89,6 @@ static int crypto_pcbc_encrypt_inplace(struct blkcipher_desc *desc, src += bsize; }while ((nbytes -= bsize) >= bsize); -memcpy (walk->iv, iv, bsize); -return nbytes; }
@@ -130,7 +128,7 @@ static int crypto_pcbc_decrypt_segment(struct blkcipher_desc *desc,unsigned int nbytes = walk->nbytes;u8 *src = walk->src.virt.addr;u8 *dst = walk->dst.virt.addr; -u8 *iv = walk->iv; +u8 *const iv = walk->iv; do { fn(crypto_cipher_tfm(tfm), dst, src);
@@ -142,8 +140,6 @@ static int crypto_pcbc_decrypt_segment(struct blkcipher_desc *desc, dst += bsize; }while ((nbytes -= bsize) >= bsize); -memcpy (walk->iv, iv, bsize); -return nbytes; }
@@ -156,7 +152,7 @@ static int crypto_pcbc_decrypt_inplace(struct blkcipher_desc *desc,int bsize =crypto_cipher_blocksize (tfm);unsigned int nbytes = walk->nbytes;u8 *src = walk->src.virt.addr; -u8 *iv = walk->iv; +u8 *const iv = walk->iv;u8 tmpbuf[bsize]; do {
@@ -169,8 +165,6 @@ static int crypto_pcbc_decrypt_inplace(struct blkcipher_desc *desc, src += bsize; }while ((nbytes -= bsize) >= bsize); -memcpy (walk->iv, iv, bsize); -return nbytes; }
drivers/atm/he.c +1 -1
@@ -717,7 +717,7 @@ static int he_init_cs_block_rcm(struct he_dev *he_dev)instead of '/ 512', use '>> 9' to prevent a call to divdu3 on x86 platforms */ - rate_cps = (unsigned long long ) (1 << exp) * (man +512 ) >>9 ; + rate_cps = (unsigned long long ) (1UL << exp) * (man +512 ) >>9 ;if (rate_cps <10 ) rate_cps =10 ;/* 2.2.1 minimum payload rate is 10 cps */
drivers/cpufreq/pxa2xx-cpufreq.c +2 -2
@@ -191,7 +191,7 @@ static int pxa_cpufreq_change_voltage(pxa_freqs_t *pxa_freq)return ret; } -static void __init pxa_cpufreq_init_voltages (void ) +static void pxa_cpufreq_init_voltages (void ) { vcc_core =regulator_get (NULL ,"vcc_core" );if (IS_ERR (vcc_core)) {
@@ -207,7 +207,7 @@ static int pxa_cpufreq_change_voltage(pxa_freqs_t *pxa_freq)return 0 ; } -static void __init pxa_cpufreq_init_voltages (void ) { } +static void pxa_cpufreq_init_voltages (void ) { }#endif static void find_freq_tables(struct cpufreq_frequency_table **freq_table,
drivers/dma/dmatest.c +12 -16
@@ -548,11 +548,9 @@ static int dmatest_func(void *data) srcs[i] = um->addr[i] + src_off; ret =dma_mapping_error (dev->dev, um->addr[i]);if (ret) { -dmaengine_unmap_put (um);result ("src mapping error" , total_tests, src_off, dst_off, len, ret); - failed_tests++; -continue ; + goto error_unmap_continue; } um->to_cnt++; }
@@ -567,11 +565,9 @@ static int dmatest_func(void *data) DMA_BIDIRECTIONAL); ret =dma_mapping_error (dev->dev, dsts[i]);if (ret) { -dmaengine_unmap_put (um);result ("dst mapping error" , total_tests, src_off, dst_off, len, ret); - failed_tests++; -continue ; + goto error_unmap_continue; } um->bidi_cnt++; }
@@ -596,12 +592,10 @@ static int dmatest_func(void *data) }if (!tx) { -dmaengine_unmap_put (um);result ("prep error" , total_tests, src_off, dst_off, len, ret);msleep (100 ); - failed_tests++; -continue ; + goto error_unmap_continue; } done.done = false;
@@ -610,12 +604,10 @@ static int dmatest_func(void *data) cookie = tx->tx_submit (tx);if (dma_submit_error (cookie)) { -dmaengine_unmap_put (um);result ("submit error" , total_tests, src_off, dst_off, len, ret);msleep (100 ); - failed_tests++; -continue ; + goto error_unmap_continue; }dma_async_issue_pending (chan);
@@ -636,16 +628,14 @@ static int dmatest_func(void *data)dmaengine_unmap_put (um);result ("test timed out" , total_tests, src_off, dst_off, len,0 ); - failed_tests++; -continue ; + goto error_unmap_continue; }else if (status !=DMA_COMPLETE ) {dmaengine_unmap_put (um);result (status ==DMA_ERROR ?"completion error status" :"completion busy status" , total_tests, src_off, dst_off, len, ret); - failed_tests++; -continue ; + goto error_unmap_continue; }dmaengine_unmap_put (um);
@@ -684,6 +674,12 @@ static int dmatest_func(void *data)verbose_result ("test passed" , total_tests, src_off, dst_off, len,0 ); } + +continue ; + +error_unmap_continue: +dmaengine_unmap_put (um); + failed_tests++; } runtime =ktime_us_delta (ktime_get (), ktime);
drivers/firmware/iscsi_ibft.c +1 -0
@@ -503,6 +503,7 @@ static umode_t __init ibft_check_tgt_for(void *data, int type)case ISCSI_BOOT_TGT_NIC_ASSOC :case ISCSI_BOOT_TGT_CHAP_TYPE : rc =S_IRUGO ; +break ;case ISCSI_BOOT_TGT_NAME :if (tgt->tgt_name_len) rc =S_IRUGO ;
drivers/gpu/drm/msm/msm_rd.c +6 -1
@@ -103,7 +103,9 @@ static void rd_write(struct msm_rd_state *rd, const void *buf, int sz)char *fptr = &fifo->buf[fifo->head];int n; -wait_event (rd->fifo_event,circ_space (&rd->fifo) >0 ); +wait_event (rd->fifo_event,circ_space (&rd->fifo) >0 || !rd->open); +if (!rd->open) +return ; n =min (sz,circ_space_to_end (&rd->fifo));memcpy (fptr, ptr, n);
@@ -192,7 +194,10 @@ out:static int rd_release (struct inode *inode,struct file *file) {struct msm_rd_state *rd = inode->i_private; + rd->open = false; +wake_up_all (&rd->fifo_event); +return 0 ; }
drivers/gpu/drm/radeon/evergreen_cs.c +1 -0
@@ -1318,6 +1318,7 @@ static int evergreen_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idx)return -EINVAL ; } ib[idx] += (u32)((reloc->gpu_offset >>8 ) &0xffffffff ); +break ;case CB_TARGET_MASK : track->cb_target_mask =radeon_get_ib_value (p, idx); track->cb_dirty = true;
drivers/i2c/busses/i2c-cadence.c +7 -2
@@ -320,8 +320,10 @@ static void cdns_i2c_mrecv(struct cdns_i2c *id)* Check for the message size against FIFO depth and set the * 'hold bus' bit if it is greater than FIFO depth. */ -if (id->recv_count >CDNS_I2C_FIFO_DEPTH ) +if ((id->recv_count >CDNS_I2C_FIFO_DEPTH ) || id->bus_hold_flag) ctrl_reg |=CDNS_I2C_CR_HOLD ; +else + ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD ;cdns_i2c_writereg (ctrl_reg,CDNS_I2C_CR_OFFSET );
@@ -375,8 +377,11 @@ static void cdns_i2c_msend(struct cdns_i2c *id)* Check for the message size against FIFO depth and set the * 'hold bus' bit if it is greater than FIFO depth. */ -if (id->send_count >CDNS_I2C_FIFO_DEPTH ) +if ((id->send_count >CDNS_I2C_FIFO_DEPTH ) || id->bus_hold_flag) ctrl_reg |=CDNS_I2C_CR_HOLD ; +else + ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD ; +cdns_i2c_writereg (ctrl_reg,CDNS_I2C_CR_OFFSET );/* Clear the interrupts in interrupt status register. */
drivers/input/keyboard/matrix_keypad.c +1 -1
@@ -220,7 +220,7 @@ static void matrix_keypad_stop(struct input_dev *dev) keypad->stopped = true;spin_unlock_irq (&keypad->lock); -flush_work (&keypad->work.work); +flush_delayed_work (&keypad->work);/* * matrix_keypad_scan() will leave IRQs enabled; * we should disable them now.
drivers/input/keyboard/st-keyscan.c +2 -2
@@ -153,6 +153,8 @@ static int keyscan_probe(struct platform_device *pdev) input_dev->id.bustype =BUS_HOST ; + keypad_data->input_dev = input_dev; + error =keypad_matrix_key_parse_dt (keypad_data);if (error)return error;
@@ -168,8 +170,6 @@ static int keyscan_probe(struct platform_device *pdev)input_set_drvdata (input_dev, keypad_data); - keypad_data->input_dev = input_dev; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); keypad_data->base =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (keypad_data->base))
drivers/input/tablet/wacom_serial4.c +2 -0
@@ -187,6 +187,7 @@ enum {MODEL_DIGITIZER_II =0x5544 ,/* UD */ MODEL_GRAPHIRE =0x4554 ,/* ET */ MODEL_PENPARTNER =0x4354 ,/* CT */ + MODEL_ARTPAD_II = 0x4B54, /* KT */ };static void wacom_handle_model_response (struct wacom *wacom)
@@ -245,6 +246,7 @@ static void wacom_handle_model_response(struct wacom *wacom) wacom->flags =F_HAS_STYLUS2 |F_HAS_SCROLLWHEEL ;break ; +case MODEL_ARTPAD_II :case MODEL_DIGITIZER_II : wacom->dev->name ="Wacom Digitizer II" ; wacom->dev->id.version =MODEL_DIGITIZER_II ;
drivers/iommu/amd_iommu.c +11 -4
@@ -2132,14 +2132,11 @@ static void do_attach(struct iommu_dev_data *dev_data,static void do_detach (struct iommu_dev_data *dev_data) { +struct protection_domain *domain = dev_data->domain;struct amd_iommu *iommu; iommu = amd_iommu_rlookup_table[dev_data->devid]; -/* decrease reference counters */ - dev_data->domain->dev_iommu[iommu->index] -=1 ; - dev_data->domain->dev_cnt -=1 ; -/* Update data structures */ dev_data->domain =NULL ;list_del (&dev_data->list);
@@ -2147,6 +2144,16 @@ static void do_detach(struct iommu_dev_data *dev_data)/* Flush the DTE entry */ device_flush_dte (dev_data); + +/* Flush IOTLB */ +domain_flush_tlb_pde (domain); + +/* Wait for the flushes to finish */ +domain_flush_complete (domain); + +/* decrease reference counters - needs to happen after the flushes */ + domain->dev_iommu[iommu->index] -=1 ; + domain->dev_cnt -=1 ; }/*
drivers/irqchip/irq-mmp.c +5 -1
@@ -35,6 +35,9 @@#define SEL_INT_PENDING (1 << 6)#define SEL_INT_NUM_MASK 0x3f +#define MMP2_ICU_INT_ROUTE_PJ4_IRQ (1 << 5) +#define MMP2_ICU_INT_ROUTE_PJ4_FIQ (1 << 6) +struct icu_chip_data {int nr_irqs;unsigned int virq_base;
@@ -191,7 +194,8 @@ static struct mmp_intc_conf mmp_conf = {static struct mmp_intc_conf mmp2_conf = { .conf_enable =0x20 , .conf_disable =0x0 , - .conf_mask =0x7f , + .conf_mask =MMP2_ICU_INT_ROUTE_PJ4_IRQ | +MMP2_ICU_INT_ROUTE_PJ4_FIQ , }; static void __exception_irq_entry mmp_handle_irq(struct pt_regs *regs)
drivers/isdn/hardware/avm/b1.c +1 -1
@@ -423,7 +423,7 @@ void b1_parse_version(avmctrl_info *cinfo)int i, j;for (j =0 ; j <AVM_MAXVERSION ; j++) - cinfo->version[j] ="\0\0" +1 ; + cinfo->version[j] ="" ;for (i =0 , j =0 ; j <AVM_MAXVERSION && i < cinfo->versionlen; j++, i += cinfo->versionbuf[i] +1 )
drivers/isdn/i4l/isdn_tty.c +5 -1
@@ -1459,15 +1459,19 @@ isdn_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios) {modem_info *info = (modem_info *) tty->driver_data; +mutex_lock (&modem_info_mutex);if (!old_termios)isdn_tty_change_speed (info);else {if (tty->termios.c_cflag == old_termios->c_cflag && tty->termios.c_ispeed == old_termios->c_ispeed && - tty->termios.c_ospeed == old_termios->c_ospeed) + tty->termios.c_ospeed == old_termios->c_ospeed) { +mutex_unlock (&modem_info_mutex);return ; + }isdn_tty_change_speed (info); } +mutex_unlock (&modem_info_mutex); }/*
drivers/leds/leds-lp5523.c +3 -1
@@ -313,7 +313,9 @@ static int lp5523_init_program_engine(struct lp55xx_chip *chip)/* Let the programs run for couple of ms and check the engine status */ usleep_range (3000 ,6000 ); -lp55xx_read (chip,LP5523_REG_STATUS , &status); + ret =lp55xx_read (chip,LP5523_REG_STATUS , &status); +if (ret) +return ret; status &=LP5523_ENG_STATUS_MASK ;if (status !=LP5523_ENG_STATUS_MASK ) {
drivers/md/raid10.c +2 -1
@@ -3836,6 +3836,8 @@ static int run(struct mddev *mddev)set_bit (MD_RECOVERY_RUNNING , &mddev->recovery); mddev->sync_thread =md_register_thread (md_do_sync, mddev,"reshape" ); +if (!mddev->sync_thread) + goto out_free_conf; }return 0 ;
@@ -4528,7 +4530,6 @@ bio_full:atomic_inc (&r10_bio->remaining); read_bio->bi_next =NULL ;generic_make_request (read_bio); - sector_nr += nr_sectors; sectors_done += nr_sectors;if (sector_nr <= last) goto read_more;
drivers/md/raid5.c +2 -0
@@ -6171,6 +6171,8 @@ static int run(struct mddev *mddev)set_bit (MD_RECOVERY_RUNNING , &mddev->recovery); mddev->sync_thread =md_register_thread (md_do_sync, mddev,"reshape" ); +if (!mddev->sync_thread) + goto abort; }/* Ok, everything is just fine now */
drivers/media/usb/uvc/uvc_driver.c +11 -3
@@ -977,11 +977,19 @@ static int uvc_parse_standard_control(struct uvc_device *dev,return -EINVAL ; } -/* Make sure the terminal type MSB is not null, otherwise it -* could be confused with a unit. +/* +* Reject invalid terminal types that would cause issues: +* +* - The high byte must be non-zero, otherwise it would be +* confused with a unit. +* +* - Bit 15 must be 0, as we use it internally as a terminal +* direction flag. +* +* Other unknown types are accepted. */ type =get_unaligned_le16 (&buffer[4 ]); -if ((type &0xff00 ) ==0 ) { +if ((type &0x7f00 ) ==0 || (type &0x8000 ) !=0 ) { uvc_trace(UVC_TRACE_DESCR, "device %d videocontrol " "interface %d INPUT_TERMINAL %d has invalid " "type 0x%04x, skipping\n", udev->devnum,
drivers/media/usb/uvc/uvc_video.c +8 -0
@@ -627,6 +627,14 @@ void uvc_video_clock_update(struct uvc_streaming *stream,u32 rem;u64 y; +/* +* We will get called from __vb2_queue_cancel() if there are buffers +* done but not dequeued by the user, but the sample array has already +* been released at that time. Just bail out in that case. +*/ +if (!clock->samples) +return ; +spin_lock_irqsave (&clock->lock, flags);if (clock->count < clock->size)
drivers/mfd/ab8500-core.c +1 -1
@@ -259,7 +259,7 @@ static int get_register_interruptible(struct ab8500 *ab8500, u8 bank,mutex_unlock (&ab8500->lock);dev_vdbg (ab8500->dev,"rd: addr %#x => data %#x\n" , addr, ret); -return ret; +return (ret <0 ) ? ret :0 ; } static int ab8500_get_register(struct device *dev, u8 bank,
drivers/mfd/db8500-prcmu.c +2 -2
@@ -2616,7 +2616,7 @@ static struct irq_chip prcmu_irq_chip = { .irq_unmask = prcmu_irq_unmask, }; -static __init char *fw_project_name (u32 project) +static char *fw_project_name (u32 project) {switch (project) {case PRCMU_FW_PROJECT_U8500 :
@@ -2765,7 +2765,7 @@ void __init db8500_prcmu_early_init(u32 phy_base, u32 size)INIT_WORK (&mb0_transfer.mask_work, prcmu_mask_work); } -static void __init init_prcm_registers (void ) +static void init_prcm_registers (void ) {u32 val;
drivers/mfd/mc13xxx-core.c +3 -1
@@ -274,7 +274,9 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode, mc13xxx->adcflags |=MC13XXX_ADC_WORKING ; -mc13xxx_reg_read (mc13xxx,MC13XXX_ADC0 , &old_adc0); + ret =mc13xxx_reg_read (mc13xxx,MC13XXX_ADC0 , &old_adc0); +if (ret) + goto out; adc0 =MC13XXX_ADC0_ADINC1 |MC13XXX_ADC0_ADINC2 ; adc1 =MC13XXX_ADC1_ADEN |MC13XXX_ADC1_ADTRIGIGN |MC13XXX_ADC1_ASC ;
drivers/mfd/ti_am335x_tscadc.c +3 -2
@@ -282,8 +282,9 @@ static int ti_tscadc_probe(struct platform_device *pdev) cell->pdata_size =sizeof (tscadc); } - err =mfd_add_devices (&pdev->dev, pdev->id, tscadc->cells, - tscadc->used_cells,NULL ,0 ,NULL ); + err =mfd_add_devices (&pdev->dev,PLATFORM_DEVID_AUTO , + tscadc->cells, tscadc->used_cells,NULL , +0 ,NULL );if (err <0 ) goto err_disable_clk;
drivers/mfd/twl-core.c +2 -2
@@ -983,7 +983,7 @@ add_children(struct twl4030_platform_data *pdata, unsigned irq_base,* letting it generate the right frequencies for USB, MADC, and * other purposes. */ -static inline int __init protect_pm_master (void ) +static inline int protect_pm_master (void ) {int e =0 ;
@@ -992,7 +992,7 @@ static inline int __init protect_pm_master(void)return e; } -static inline int __init unprotect_pm_master (void ) +static inline int unprotect_pm_master (void ) {int e =0 ;
drivers/mfd/wm5110-tables.c +2 -0
@@ -1617,6 +1617,7 @@ static const struct reg_default wm5110_reg_default[] = { { 0x00000ECD, 0x0000 }, /* R3789 - HPLPF4_2 */ { 0x00000EE0, 0x0000 }, /* R3808 - ASRC_ENABLE */ { 0x00000EE2, 0x0000 }, /* R3810 - ASRC_RATE1 */ + { 0x00000EE3, 0x4000 }, /* R3811 - ASRC_RATE2 */ { 0x00000EF0, 0x0000 }, /* R3824 - ISRC 1 CTRL 1 */ { 0x00000EF1, 0x0000 }, /* R3825 - ISRC 1 CTRL 2 */ { 0x00000EF2, 0x0000 }, /* R3826 - ISRC 1 CTRL 3 */
@@ -2684,6 +2685,7 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg)case ARIZONA_ASRC_ENABLE :case ARIZONA_ASRC_STATUS :case ARIZONA_ASRC_RATE1 : +case ARIZONA_ASRC_RATE2 :case ARIZONA_ISRC_1_CTRL_1 :case ARIZONA_ISRC_1_CTRL_2 :case ARIZONA_ISRC_1_CTRL_3 :
drivers/mmc/host/mmc_spi.c +1 -0
@@ -1451,6 +1451,7 @@ static int mmc_spi_probe(struct spi_device *spi)if (status !=0 ) goto fail_add_host; } +mmc_detect_change (mmc,0 ); dev_info(&spi->dev, "SD/MMC host %s%s%s%s%s\n", dev_name(&mmc->class_dev),
drivers/net/ethernet/altera/altera_msgdma.c +2 -1
@@ -145,7 +145,8 @@ u32 msgdma_tx_completions(struct altera_tse_private *priv) &0xffff ;if (inuse) {/* Tx FIFO is not empty */ - ready = priv->tx_prod - priv->tx_cons - inuse -1 ; + ready =max_t (int, + priv->tx_prod - priv->tx_cons - inuse -1 ,0 ); }else {/* Check for buffered last packet */ status =csrrd32 (priv->tx_dma_csr,msgdma_csroffs (status));
drivers/net/ethernet/altera/altera_tse_main.c +3 -1
@@ -706,8 +706,10 @@ static struct phy_device *connect_local_phy(struct net_device *dev) phydev =phy_connect (dev, phy_id_fmt, &altera_tse_adjust_link, priv->phy_iface); -if (IS_ERR (phydev)) +if (IS_ERR (phydev)) {netdev_err (dev,"Could not attach to PHY\n" ); + phydev =NULL ; + } }else {int ret;
drivers/net/ethernet/atheros/atlx/atl2.c +1 -3
@@ -1338,13 +1338,11 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent) {struct net_device *netdev;struct atl2_adapter *adapter; -static int cards_found; +static int cards_found =0 ;unsigned long mmio_start;int mmio_len;int err; - cards_found =0 ; - err =pci_enable_device (pdev);if (err)return err;
drivers/net/ethernet/broadcom/bcmsysport.c +4 -0
@@ -126,6 +126,10 @@ static int bcm_sysport_set_rx_csum(struct net_device *dev, priv->rx_chk_en = !!(wanted &NETIF_F_RXCSUM ); reg =rxchk_readl (priv,RXCHK_CONTROL ); +/* Clear L2 header checks, which would prevent BPDUs +* from being received. +*/ + reg &= ~RXCHK_L2_HDR_DIS ;if (priv->rx_chk_en) reg |=RXCHK_EN ;else
drivers/net/ethernet/ibm/ibmveth.c +0 -2
@@ -1085,7 +1085,6 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)int frames_processed =0 ;unsigned long lpar_rc; -restart_poll:while (frames_processed < budget) {if (!ibmveth_rxq_pending_buffer (adapter))break ;
@@ -1154,7 +1153,6 @@ restart_poll: napi_reschedule(napi)) { lpar_rc =h_vio_signal (adapter->vdev->unit_address,VIO_IRQ_DISABLE ); - goto restart_poll; } }
drivers/net/ethernet/marvell/mv643xx_eth.c +6 -1
@@ -2814,7 +2814,7 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev) ret =mv643xx_eth_shared_of_probe (pdev);if (ret) -return ret; + goto err_put_clk; pd =dev_get_platdata (&pdev->dev); msp->tx_csum_limit = (pd != NULL && pd->tx_csum_limit) ?
@@ -2822,6 +2822,11 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)infer_hw_params (msp);return 0 ; + +err_put_clk: +if (!IS_ERR (msp->clk)) +clk_disable_unprepare (msp->clk); +return ret; }static int mv643xx_eth_shared_remove (struct platform_device *pdev)
drivers/net/ethernet/marvell/sky2.c +23 -1
@@ -46,6 +46,7 @@#include <linux/mii.h> #include <linux/of_device.h> #include <linux/of_net.h> +#include <linux/dmi.h> #include <asm/irq.h>
@@ -93,7 +94,7 @@ static int copybreak __read_mostly = 128;module_param (copybreak, int,0 );MODULE_PARM_DESC (copybreak,"Receive copy threshold" ); -static int disable_msi =0 ; +static int disable_msi =-1 ;module_param (disable_msi, int,0 );MODULE_PARM_DESC (disable_msi,"Disable Message Signaled Interrupt (MSI)" );
@@ -4913,6 +4914,24 @@ static const char *sky2_name(u8 chipid, char *buf, int sz)return buf; } +static const struct dmi_system_id msi_blacklist[] = { + { + .ident ="Dell Inspiron 1545" , + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Inspiron 1545" ), + }, + }, + { + .ident ="Gateway P-79" , + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Gateway" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"P-79" ), + }, + }, + {} +}; +static int sky2_probe (struct pci_dev *pdev,const struct pci_device_id *ent) {struct net_device *dev, *dev1;
@@ -5024,6 +5043,9 @@ static int sky2_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_out_free_pci; } +if (disable_msi ==-1 ) + disable_msi = !!dmi_check_system (msi_blacklist); +if (!disable_msi &&pci_enable_msi (pdev) ==0 ) { err =sky2_test_msi (hw);if (err) {
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +3 -3
@@ -2474,13 +2474,13 @@ static int qp_get_mtt_size(struct mlx4_qp_context *qpc)int total_pages;int total_mem;int page_offset = (be32_to_cpu (qpc->params2) >>6 ) &0x3f ; +int tot; sq_size =1 << (log_sq_size + log_sq_sride +4 ); rq_size = (srq|rss|xrc) ?0 : (1 << (log_rq_size + log_rq_stride +4 )); total_mem = sq_size + rq_size; - total_pages = -roundup_pow_of_two ((total_mem + (page_offset <<6 )) >> - page_shift); + tot = (total_mem + (page_offset <<6 )) >> page_shift; + total_pages = !tot ?1 :roundup_pow_of_two (tot);return total_pages; }
drivers/net/phy/mdio_bus.c +0 -1
@@ -261,7 +261,6 @@ int mdiobus_register(struct mii_bus *bus) err =device_register (&bus->dev);if (err) {pr_err ("mii_bus %s failed to register\n" , bus->id); -put_device (&bus->dev);return -EINVAL ; }
drivers/net/phy/micrel.c +13 -1
@@ -27,6 +27,7 @@#include <linux/micrel_phy.h> #include <linux/of.h> #include <linux/clk.h> +#include <uapi/linux/mdio.h> /* Operation Mode Strap Override */ #define MII_KSZPHY_OMSO 0x16
@@ -217,6 +218,17 @@ static int ks8051_config_init(struct phy_device *phydev)return rc <0 ? rc :0 ; } +static int ksz8061_config_init (struct phy_device *phydev) +{ +int ret; + + ret =phy_write_mmd (phydev,MDIO_MMD_PMAPMD ,MDIO_DEVID1 ,0xB61A ); +if (ret) +return ret; + +return kszphy_config_init (phydev); +} + static int ksz9021_load_values_from_of(struct phy_device *phydev, struct device_node *of_node, u16 reg, char *field1, char *field2,
@@ -593,7 +605,7 @@ static struct phy_driver ksphy_driver[] = { .phy_id_mask = 0x00fffff0, .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause), .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, - .config_init = kszphy_config_init, + .config_init = ksz8061_config_init, .config_aneg = genphy_config_aneg, .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt,
drivers/net/ppp/pptp.c +1 -0
@@ -564,6 +564,7 @@ static void pptp_sock_destruct(struct sock *sk)pppox_unbind_sock (sk); }skb_queue_purge (&sk->sk_receive_queue); +dst_release (rcu_dereference_protected (sk->sk_dst_cache,1 )); }static int pptp_create (struct net *net,struct socket *sock)
drivers/net/team/team.c +5 -22
@@ -253,17 +253,6 @@ static void __team_option_inst_mark_removed_port(struct team *team, } } -static bool __team_option_inst_tmp_find (const struct list_head *opts, -const struct team_option_inst *needle) -{ -struct team_option_inst *opt_inst; - -list_for_each_entry (opt_inst, opts, tmp_list) -if (opt_inst == needle) -return true; -return false; -} -static int __team_options_register (struct team *team,const struct team_option *option,size_t option_count)
@@ -2435,7 +2424,6 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info)int err =0 ;int i;struct nlattr *nl_option; -LIST_HEAD (opt_inst_list); team =team_nl_team_get (info);if (!team)
@@ -2451,6 +2439,7 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info)struct nlattr *opt_attrs[TEAM_ATTR_OPTION_MAX +1 ];struct nlattr *attr;struct nlattr *attr_data; +LIST_HEAD (opt_inst_list);enum team_option_type opt_type;int opt_port_ifindex =0 ;/* != 0 for per-port options */ u32 opt_array_index =0 ;
@@ -2554,23 +2543,17 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info)if (err) goto team_put; opt_inst->changed = true; - -/* dumb/evil user-space can send us duplicate opt, -* keep only the last one -*/ -if (__team_option_inst_tmp_find (&opt_inst_list, - opt_inst)) -continue ; -list_add (&opt_inst->tmp_list, &opt_inst_list); }if (!opt_found) { err = -ENOENT ; goto team_put; } - } - err =team_nl_send_event_options_get (team, &opt_inst_list); + err =team_nl_send_event_options_get (team, &opt_inst_list); +if (err) +break ; + } team_put:team_nl_team_put (team);
drivers/net/team/team_mode_loadbalance.c +15 -0
@@ -305,6 +305,20 @@ static int lb_bpf_func_set(struct team *team, struct team_gsetter_ctx *ctx)return 0 ; } +static void lb_bpf_func_free (struct team *team) +{ +struct lb_priv *lb_priv =get_lb_priv (team); +struct bpf_prog *fp; + +if (!lb_priv->ex->orig_fprog) +return ; + +__fprog_destroy (lb_priv->ex->orig_fprog); + fp =rcu_dereference_protected (lb_priv->fp, +lockdep_is_held (&team->lock)); +bpf_prog_destroy (fp); +} +static int lb_tx_method_get (struct team *team,struct team_gsetter_ctx *ctx) {struct lb_priv *lb_priv =get_lb_priv (team);
@@ -619,6 +633,7 @@ static void lb_exit(struct team *team)team_options_unregister (team, lb_options,ARRAY_SIZE (lb_options)); +lb_bpf_func_free (team);cancel_delayed_work_sync (&lb_priv->ex->stats.refresh_dw);free_percpu (lb_priv->pcpu_stats);kfree (lb_priv->ex);
drivers/net/vxlan.c +10 -0
@@ -1238,6 +1238,14 @@ static void vxlan_rcv(struct vxlan_sock *vs, } } +rcu_read_lock (); + +if (unlikely (!(vxlan->dev->flags &IFF_UP ))) { +rcu_read_unlock (); +atomic_long_inc (&vxlan->dev->rx_dropped); + goto drop; + } + stats =this_cpu_ptr (vxlan->dev->tstats);u64_stats_update_begin (&stats->syncp); stats->rx_packets++;
@@ -1246,6 +1254,8 @@ static void vxlan_rcv(struct vxlan_sock *vs,netif_rx (skb); +rcu_read_unlock (); +return ; drop:/* Consume bad packet */
drivers/parport/parport_pc.c +1 -1
@@ -1377,7 +1377,7 @@ static struct superio_struct *find_superio(struct parport *p) {int i;for (i =0 ; i <NR_SUPERIOS ; i++) -if (superios[i].io != p->base) +if (superios[i].io == p->base)return &superios[i];return NULL ; }
drivers/platform/x86/Kconfig +1 -0
@@ -806,6 +806,7 @@ config INTEL_OAKTRAIL config SAMSUNG_Q10 tristate "Samsung Q10 Extras" depends on ACPI + depends on BACKLIGHT_LCD_SUPPORT select BACKLIGHT_CLASS_DEVICE ---help--- This driver provides support for backlight control on Samsung Q10
drivers/regulator/s2mpa01.c +5 -5
@@ -303,13 +303,13 @@ static struct regulator_desc regulators[] = {regulator_desc_ldo (2 ,STEP_50_MV ),regulator_desc_ldo (3 ,STEP_50_MV ),regulator_desc_ldo (4 ,STEP_50_MV ), -regulator_desc_ldo (5 ,STEP_50_MV ), +regulator_desc_ldo (5 ,STEP_25_MV ),regulator_desc_ldo (6 ,STEP_25_MV ),regulator_desc_ldo (7 ,STEP_50_MV ),regulator_desc_ldo (8 ,STEP_50_MV ),regulator_desc_ldo (9 ,STEP_50_MV ),regulator_desc_ldo (10 ,STEP_50_MV ), -regulator_desc_ldo (11 ,STEP_25_MV ), +regulator_desc_ldo (11 ,STEP_50_MV ),regulator_desc_ldo (12 ,STEP_50_MV ),regulator_desc_ldo (13 ,STEP_50_MV ), regulator_desc_ldo(14, STEP_50_MV),
@@ -320,11 +320,11 @@ static struct regulator_desc regulators[] = {regulator_desc_ldo (19 ,STEP_50_MV ),regulator_desc_ldo (20 ,STEP_50_MV ),regulator_desc_ldo (21 ,STEP_50_MV ), -regulator_desc_ldo (22 ,STEP_25_MV ), -regulator_desc_ldo (23 ,STEP_25_MV ), +regulator_desc_ldo (22 ,STEP_50_MV ), +regulator_desc_ldo (23 ,STEP_50_MV ),regulator_desc_ldo (24 ,STEP_50_MV ),regulator_desc_ldo (25 ,STEP_50_MV ), -regulator_desc_ldo (26 ,STEP_50_MV ), +regulator_desc_ldo (26 ,STEP_25_MV ),regulator_desc_buck1_4 (1 ),regulator_desc_buck1_4 (2 ), regulator_desc_buck1_4(3),
drivers/regulator/s2mps11.c +3 -3
@@ -369,7 +369,7 @@ static const struct regulator_desc s2mps11_regulators[] = {regulator_desc_s2mps11_ldo (32 ,STEP_50_MV ),regulator_desc_s2mps11_ldo (33 ,STEP_50_MV ),regulator_desc_s2mps11_ldo (34 ,STEP_50_MV ), -regulator_desc_s2mps11_ldo (35 ,STEP_50_MV ), +regulator_desc_s2mps11_ldo (35 ,STEP_25_MV ),regulator_desc_s2mps11_ldo (36 ,STEP_50_MV ),regulator_desc_s2mps11_ldo (37 ,STEP_50_MV ), regulator_desc_s2mps11_ldo(38, STEP_50_MV),
@@ -379,8 +379,8 @@ static const struct regulator_desc s2mps11_regulators[] = {regulator_desc_s2mps11_buck1_4 (4 ), regulator_desc_s2mps11_buck5,regulator_desc_s2mps11_buck67810 (6 ,MIN_600_MV ,STEP_6_25_MV ), -regulator_desc_s2mps11_buck67810 (7 ,MIN_600_MV ,STEP_6_25_MV ), -regulator_desc_s2mps11_buck67810 (8 ,MIN_600_MV ,STEP_6_25_MV ), +regulator_desc_s2mps11_buck67810 (7 ,MIN_600_MV ,STEP_12_5_MV ), +regulator_desc_s2mps11_buck67810 (8 ,MIN_600_MV ,STEP_12_5_MV ), regulator_desc_s2mps11_buck9, regulator_desc_s2mps11_buck67810(10, MIN_750_MV, STEP_12_5_MV), };
drivers/s390/block/dasd_eckd.c +8 -0
@@ -3990,6 +3990,14 @@ static int dasd_symm_io(struct dasd_device *device, void __user *argp) usrparm.psf_data &=0x7fffffffULL ; usrparm.rssd_result &=0x7fffffffULL ; } +/* at least 2 bytes are accessed and should be allocated */ +if (usrparm.psf_data_len <2 ) { +DBF_DEV_EVENT (DBF_WARNING , device, +"Symmetrix ioctl invalid data length %d" , + usrparm.psf_data_len); + rc = -EINVAL ; + goto out; + }/* alloc I/O data area */ psf_data =kzalloc (usrparm.psf_data_len,GFP_KERNEL |GFP_DMA ); rssd_result =kzalloc (usrparm.rssd_result_len,GFP_KERNEL |GFP_DMA );
drivers/s390/net/qeth_core_main.c +6 -9
@@ -2423,11 +2423,12 @@ out:return rc; } -static void qeth_free_qdio_out_buf (struct qeth_qdio_out_q *q) +static void qeth_free_output_queue (struct qeth_qdio_out_q *q) {if (!q)return ; +qeth_clear_outq_buffers (q,1 );qdio_free_buffers (q->qdio_bufs,QDIO_MAX_BUFFERS_PER_Q );kfree (q); }
@@ -2500,10 +2501,8 @@ out_freeoutqbufs: card->qdio.out_qs[i]->bufs[j] =NULL ; } out_freeoutq: -while (i >0 ) { -qeth_free_qdio_out_buf (card->qdio.out_qs[--i]); -qeth_clear_outq_buffers (card->qdio.out_qs[i],1 ); - } +while (i >0 ) +qeth_free_output_queue (card->qdio.out_qs[--i]);kfree (card->qdio.out_qs); card->qdio.out_qs =NULL ; out_freepool:
@@ -2536,10 +2535,8 @@ static void qeth_free_qdio_buffers(struct qeth_card *card)qeth_free_buffer_pool (card);/* free outbound qdio_qs */ if (card->qdio.out_qs) { -for (i =0 ; i < card->qdio.no_out_queues; ++i) { -qeth_clear_outq_buffers (card->qdio.out_qs[i],1 ); -qeth_free_qdio_out_buf (card->qdio.out_qs[i]); - } +for (i =0 ; i < card->qdio.no_out_queues; i++) +qeth_free_output_queue (card->qdio.out_qs[i]);kfree (card->qdio.out_qs); card->qdio.out_qs =NULL ; }
drivers/scsi/csiostor/csio_attr.c +1 -1
@@ -582,12 +582,12 @@ csio_vport_create(struct fc_vport *fc_vport, bool disable) }fc_vport_set_state (fc_vport,FC_VPORT_INITIALIZING ); + ln->fc_vport = fc_vport;if (csio_fcoe_alloc_vnp (hw, ln)) goto error; *(struct csio_lnode **)fc_vport->dd_data = ln; - ln->fc_vport = fc_vport;if (!fc_vport->node_name) fc_vport->node_name =wwn_to_u64 (csio_ln_wwnn (ln));if (!fc_vport->port_name)
drivers/scsi/isci/init.c +7 -7
@@ -598,6 +598,13 @@ static struct isci_host *isci_host_alloc(struct pci_dev *pdev, int id) shost->max_lun = ~0 ; shost->max_cmd_len =MAX_COMMAND_SIZE ; +/* turn on DIF support */ +scsi_host_set_prot (shost, +SHOST_DIF_TYPE1_PROTECTION | +SHOST_DIF_TYPE2_PROTECTION | +SHOST_DIF_TYPE3_PROTECTION ); +scsi_host_set_guard (shost,SHOST_DIX_GUARD_CRC ); + err =scsi_add_host (shost, &pdev->dev);if (err) goto err_shost;
@@ -685,13 +692,6 @@ static int isci_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto err_host_alloc; } pci_info->hosts[i] = h; - -/* turn on DIF support */ -scsi_host_set_prot (to_shost (h), -SHOST_DIF_TYPE1_PROTECTION | -SHOST_DIF_TYPE2_PROTECTION | -SHOST_DIF_TYPE3_PROTECTION ); -scsi_host_set_guard (to_shost (h),SHOST_DIX_GUARD_CRC ); } err =isci_setup_interrupts (pdev);
drivers/scsi/libfc/fc_lport.c +3 -3
@@ -1739,14 +1739,14 @@ void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, fc_frame_payload_op(fp) != ELS_LS_ACC) {FC_LPORT_DBG (lport,"FLOGI not accepted or bad response\n" );fc_lport_error (lport, fp); - goto err; + goto out; } flp =fc_frame_payload_get (fp,sizeof (*flp));if (!flp) {FC_LPORT_DBG (lport,"FLOGI bad response\n" );fc_lport_error (lport, fp); - goto err; + goto out; } mfs = ntohs(flp->fl_csp.sp_bb_data) &
@@ -1756,7 +1756,7 @@ void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,FC_LPORT_DBG (lport,"FLOGI bad mfs:%hu response, " "lport->mfs:%hu\n" , mfs, lport->mfs);fc_lport_error (lport, fp); - goto err; + goto out; }if (mfs <= lport->mfs) {
drivers/scsi/libiscsi.c +6 -0
@@ -1448,7 +1448,13 @@ static int iscsi_xmit_task(struct iscsi_conn *conn)if (test_bit (ISCSI_SUSPEND_BIT , &conn->suspend_tx))return -ENODATA ; +spin_lock_bh (&conn->session->back_lock); +if (conn->task ==NULL ) { +spin_unlock_bh (&conn->session->back_lock); +return -ENODATA ; + }__iscsi_get_task (task); +spin_unlock_bh (&conn->session->back_lock);spin_unlock_bh (&conn->session->frwd_lock); rc = conn->session->tt->xmit_task (task);spin_lock_bh (&conn->session->frwd_lock);
drivers/scsi/libsas/sas_expander.c +2 -0
@@ -818,6 +818,7 @@ static struct domain_device *sas_ex_discover_end_dev( rphy =sas_end_device_alloc (phy->port);if (!rphy) goto out_free; + rphy->identify.phy_identifier = phy_id; child->rphy = rphy;get_device (&rphy->dev);
@@ -845,6 +846,7 @@ static struct domain_device *sas_ex_discover_end_dev( child->rphy = rphy;get_device (&rphy->dev); + rphy->identify.phy_identifier = phy_id;sas_fill_in_rphy (child, rphy);list_add_tail (&child->disco_list_node, &parent->port->disco_list);
drivers/scsi/qla4xxx/ql4_os.c +2 -0
@@ -7251,6 +7251,8 @@ static int qla4xxx_sysfs_ddb_tgt_create(struct scsi_qla_host *ha, rc =qla4xxx_copy_from_fwddb_param (fnode_sess, fnode_conn, fw_ddb_entry); +if (rc) + goto free_sess;ql4_printk (KERN_INFO , ha,"%s: sysfs entry %s created\n" , __func__, fnode_sess->dev.kobj.name);
drivers/scsi/virtio_scsi.c +0 -2
@@ -653,7 +653,6 @@ static int virtscsi_device_reset(struct scsi_cmnd *sc)return FAILED ;memset (cmd,0 ,sizeof (*cmd)); - cmd->sc = sc; cmd->req.tmf = (struct virtio_scsi_ctrl_tmf_req ){ .type =VIRTIO_SCSI_T_TMF , .subtype =VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET ,
@@ -728,7 +727,6 @@ static int virtscsi_abort(struct scsi_cmnd *sc)return FAILED ;memset (cmd,0 ,sizeof (*cmd)); - cmd->sc = sc; cmd->req.tmf = (struct virtio_scsi_ctrl_tmf_req ){ .type =VIRTIO_SCSI_T_TMF , .subtype =VIRTIO_SCSI_T_TMF_ABORT_TASK ,
drivers/target/iscsi/iscsi_target.c +2 -2
@@ -4198,9 +4198,9 @@ static void iscsit_release_commands_from_conn(struct iscsi_conn *conn)struct se_cmd *se_cmd = &cmd->se_cmd;if (se_cmd->se_tfo !=NULL ) { -spin_lock (&se_cmd->t_state_lock); +spin_lock_irq (&se_cmd->t_state_lock); se_cmd->transport_state |=CMD_T_FABRIC_STOP ; -spin_unlock (&se_cmd->t_state_lock); +spin_unlock_irq (&se_cmd->t_state_lock); } }spin_unlock_bh (&conn->cmd_lock);
drivers/tty/serial/fsl_lpuart.c +1 -1
@@ -1426,7 +1426,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, }/* ask the core to calculate the divisor */ - baud =uart_get_baud_rate (port, termios, old,50 , port->uartclk /16 ); + baud =uart_get_baud_rate (port, termios, old,50 , port->uartclk /4 );spin_lock_irqsave (&sport->port.lock, flags);
drivers/usb/dwc3/gadget.c +1 -0
@@ -1641,6 +1641,7 @@ static int dwc3_gadget_start(struct usb_gadget *g,/* begin to receive SETUP packets */ dwc->ep0state =EP0_SETUP_PHASE ; + dwc->link_state =DWC3_LINK_STATE_SS_DIS ;dwc3_ep0_out_start (dwc);dwc3_gadget_enable_irq (dwc);
drivers/usb/gadget/function/f_sourcesink.c +1 -1
@@ -1149,7 +1149,7 @@ static struct usb_function *source_sink_alloc_func( ss =kzalloc (sizeof (*ss),GFP_KERNEL );if (!ss) -return NULL ; +return ERR_PTR (-ENOMEM ); ss_opts = container_of(fi, struct f_ss_opts, func_inst);
drivers/usb/serial/cp210x.c +1 -0
@@ -57,6 +57,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ { USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */ { USB_DEVICE(0x0908, 0x01FF) }, /* Siemens RUGGEDCOM USB Serial Console */ + { USB_DEVICE(0x0B00, 0x3070) }, /* Ingenico 3070 */ { USB_DEVICE(0x0BED, 0x1100) }, /* MEI (TM) Cashflow-SC Bill/Voucher Acceptor */ { USB_DEVICE(0x0BED, 0x1101) }, /* MEI series 2000 Combo Acceptor */ { USB_DEVICE(0x0FCF, 0x1003) }, /* Dynastream ANT development board */
fs/autofs4/expire.c +2 -1
@@ -570,7 +570,6 @@ int autofs4_expire_run(struct super_block *sb, pkt.len = dentry->d_name.len;memcpy (pkt.name, dentry->d_name.name, pkt.len); pkt.name[pkt.len] ='\0' ; -dput (dentry);if (copy_to_user (pkt_p, &pkt,sizeof (struct autofs_packet_expire )) ) ret = -EFAULT ;
@@ -583,6 +582,8 @@ int autofs4_expire_run(struct super_block *sb,complete_all (&ino->expire_complete);spin_unlock (&sbi->fs_lock); +dput (dentry); +return ret; }
fs/autofs4/inode.c +3 -1
@@ -256,8 +256,10 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) } root_inode =autofs4_get_inode (s,S_IFDIR |0755 ); root =d_make_root (root_inode); -if (!root) +if (!root) { + ret = -ENOMEM ; goto fail_ino; + } pipe =NULL ; root->d_fsdata = ino;
fs/btrfs/extent_io.c +2 -2
@@ -3015,11 +3015,11 @@ static int __do_readpage(struct extent_io_tree *tree,*/ if (test_bit (EXTENT_FLAG_COMPRESSED , &em->flags) && prev_em_start && *prev_em_start != (u64)-1 && - *prev_em_start != em->orig_start) + *prev_em_start != em->start) force_bio_submit = true;if (prev_em_start) - *prev_em_start = em->orig_start; + *prev_em_start = em->start;free_extent_map (em); em =NULL ;
fs/ceph/snap.c +2 -1
@@ -566,7 +566,8 @@ int __ceph_finish_cap_snap(struct ceph_inode_info *ci, capsnap->size);spin_lock (&mdsc->snap_flush_lock); -list_add_tail (&ci->i_snap_flush_item, &mdsc->snap_flush_list); +if (list_empty (&ci->i_snap_flush_item)) +list_add_tail (&ci->i_snap_flush_item, &mdsc->snap_flush_list);spin_unlock (&mdsc->snap_flush_lock);return 1 ;/* caller may want to ceph_flush_snaps */ }
fs/cifs/file.c +7 -5
@@ -2772,14 +2772,16 @@ cifs_strict_writev(struct kiocb *iocb, struct iov_iter *from)* these pages but not on the region from pos to ppos+len-1. */ written =cifs_user_writev (iocb, from); -if (written >0 &&CIFS_CACHE_READ (cinode)) { +if (CIFS_CACHE_READ (cinode)) {/* -* Windows 7 server can delay breaking level2 oplock if a write -* request comes - break it on the client to prevent reading -* an old data. +* We have read level caching and we have just sent a write +* request to the server thus making data in the cache stale. +* Zap the cache and set oplock/lease level to NONE to avoid +* reading stale data from the cache. All subsequent read +* operations will read new data from the server. */ cifs_zap_mapping (inode); -cifs_dbg (FYI ,"Set no oplock for inode=%p after a write operation\n" , +cifs_dbg (FYI ,"Set Oplock/Lease to NONE for inode=%p after write\n" , inode); cinode->oplock =0 ; }
fs/cifs/smb2pdu.h +2 -2
@@ -82,8 +82,8 @@#define NUMBER_OF_SMB2_COMMANDS 0x0013 -/* 4 len + 52 transform hdr + 64 hdr + 56 create rsp */ -#define MAX_SMB2_HDR_SIZE 0x00b0 +/* 52 transform hdr + 64 hdr + 88 create rsp */ +#define MAX_SMB2_HDR_SIZE 204#define SMB2_PROTO_NUMBER __constant_cpu_to_le32(0x424d53fe)
fs/ext2/super.c +25 -14
@@ -701,7 +701,8 @@ static loff_t ext2_max_size(int bits) {loff_t res =EXT2_NDIR_BLOCKS ;int meta_blocks; -loff_t upper_limit; +unsigned int upper_limit; +unsigned int ppb =1 << (bits-2 );/* This is calculated to be the largest file size for a * dense, file such that the total number of
@@ -715,24 +716,34 @@ static loff_t ext2_max_size(int bits)/* total blocks in file system block size */ upper_limit >>= (bits -9 ); +/* Compute how many blocks we can address by block tree */ + res +=1LL << (bits-2 ); + res +=1LL << (2 *(bits-2 )); + res +=1LL << (3 *(bits-2 )); +/* Does block tree limit file size? */ +if (res < upper_limit) + goto check_lfs; + res = upper_limit; +/* How many metadata blocks are needed for addressing upper_limit? */ + upper_limit -=EXT2_NDIR_BLOCKS ;/* indirect blocks */ meta_blocks =1 ; + upper_limit -= ppb;/* double indirect blocks */ - meta_blocks +=1 + (1LL << (bits-2 )); -/* tripple indirect blocks */ - meta_blocks +=1 + (1LL << (bits-2 )) + (1LL << (2 *(bits-2 ))); - - upper_limit -= meta_blocks; - upper_limit <<= bits; - - res +=1LL << (bits-2 ); - res +=1LL << (2 *(bits-2 )); - res +=1LL << (3 *(bits-2 )); +if (upper_limit < ppb * ppb) { + meta_blocks +=1 +DIV_ROUND_UP (upper_limit, ppb); + res -= meta_blocks; + goto check_lfs; + } + meta_blocks +=1 + ppb; + upper_limit -= ppb * ppb; +/* tripple indirect blocks for the rest */ + meta_blocks +=1 +DIV_ROUND_UP (upper_limit, ppb) + +DIV_ROUND_UP (upper_limit, ppb*ppb); + res -= meta_blocks; +check_lfs: res <<= bits; -if (res > upper_limit) - res = upper_limit; -if (res >MAX_LFS_FILESIZE ) res =MAX_LFS_FILESIZE ;
fs/ext4/resize.c +2 -1
@@ -1930,7 +1930,8 @@ retry:le16_to_cpu (es->s_reserved_gdt_blocks); n_group = n_desc_blocks *EXT4_DESC_PER_BLOCK (sb); n_blocks_count = (ext4_fsblk_t )n_group * -EXT4_BLOCKS_PER_GROUP (sb); +EXT4_BLOCKS_PER_GROUP (sb) + +le32_to_cpu (es->s_first_data_block); n_group--;/* set to last group number */ }
fs/hugetlbfs/inode.c +12 -0
@@ -609,6 +609,18 @@ static int hugetlbfs_migrate_page(struct address_space *mapping, rc =migrate_huge_page_move_mapping (mapping, newpage, page);if (rc !=MIGRATEPAGE_SUCCESS )return rc; + +/* +* page_private is subpool pointer in hugetlb pages. Transfer to +* new page. PagePrivate is not associated with page_private for +* hugetlb pages and can not be set here as only page_huge_active +* pages can be migrated. +*/ +if (page_private (page)) { +set_page_private (newpage,page_private (page)); +set_page_private (page,0 ); + } +migrate_page_copy (newpage, page);return MIGRATEPAGE_SUCCESS ;
fs/jbd2/transaction.c +12 -5
@@ -1473,14 +1473,21 @@ int jbd2_journal_forget (handle_t *handle, struct buffer_head *bh)/* However, if the buffer is still owned by a prior * (committing) transaction, we can't drop it yet... */ JBUFFER_TRACE (jh,"belongs to older transaction" ); -/* ... but we CAN drop it from the new transaction if we -* have also modified it since the original commit. */ +/* ... but we CAN drop it from the new transaction through +* marking the buffer as freed and set j_next_transaction to +* the new transaction, so that not only the commit code +* knows it should clear dirty bits when it is done with the +* buffer, but also the buffer can be checkpointed only +* after the new transaction commits. */ -if (jh->b_next_transaction) { -J_ASSERT (jh->b_next_transaction == transaction); +set_buffer_freed (bh); + +if (!jh->b_next_transaction) {spin_lock (&journal->j_list_lock); - jh->b_next_transaction =NULL ; + jh->b_next_transaction = transaction;spin_unlock (&journal->j_list_lock); + }else { +J_ASSERT (jh->b_next_transaction == transaction);/* * only drop a reference if this transaction modified
fs/nfs/super.c +5 -0
@@ -1876,6 +1876,11 @@ static int nfs_parse_devname(const char *dev_name,size_t len;char *end; +if (unlikely (!dev_name || !*dev_name)) { +dfprintk (MOUNT ,"NFS: device name not specified\n" ); +return -EINVAL ; + } +/* Is the host name protected with square brakcets? */ if (*dev_name =='[' ) { end =strchr (++dev_name,']' );
fs/nfsd/nfs3proc.c +14 -2
@@ -430,8 +430,19 @@ nfsd3_proc_readdir(struct svc_rqst *rqstp, struct nfsd3_readdirargs *argp, &resp->common, nfs3svc_encode_entry);memcpy (resp->verf, argp->verf,8 ); resp->count = resp->buffer - argp->buffer; -if (resp->offset) -xdr_encode_hyper (resp->offset, argp->cookie); +if (resp->offset) { +loff_t offset = argp->cookie; + +if (unlikely (resp->offset1)) { +/* we ended up with offset on a page boundary */ + *resp->offset =htonl (offset >>32 ); + *resp->offset1 =htonl (offset &0xffffffff ); + resp->offset1 =NULL ; + }else { +xdr_encode_hyper (resp->offset, offset); + } + resp->offset =NULL ; + }RETURN_STATUS (nfserr); }
@@ -499,6 +510,7 @@ nfsd3_proc_readdirplus(struct svc_rqst *rqstp, struct nfsd3_readdirargs *argp, }else {xdr_encode_hyper (resp->offset, offset); } + resp->offset =NULL ; }RETURN_STATUS (nfserr);
fs/nfsd/nfs3xdr.c +1 -0
@@ -892,6 +892,7 @@ encode_entry(struct readdir_cd *ccd, const char *name, int namlen, }else {xdr_encode_hyper (cd->offset, offset64); } + cd->offset =NULL ; }/*
fs/nfsd/nfsctl.c +1 -1
@@ -1110,7 +1110,7 @@ static ssize_t write_v4_end_grace(struct file *file, char *buf, size_t size)case 'Y' :case 'y' :case '1' : -if (nn->nfsd_serv) +if (!nn->nfsd_serv)return -EBUSY ;nfsd4_end_grace (nn);break ;
include/keys/user-type.h +1 -1
@@ -29,7 +29,7 @@struct user_key_payload {struct rcu_head rcu;/* RCU destructor */ unsigned short datalen;/* length of this data */ -char data[0 ];/* actual data */ +char data[0 ]__aligned(__alignof__(u64)) ;/* actual data */ };extern struct key_type key_type_user;
include/net/gro_cells.h +10 -2
@@ -20,18 +20,23 @@ static inline void gro_cells_receive(struct gro_cells *gcells, struct sk_buff *sstruct gro_cell *cell = gcells->cells;struct net_device *dev = skb->dev; +rcu_read_lock (); +if (unlikely (!(dev->flags &IFF_UP ))) + goto drop; +if (!cell ||skb_cloned (skb) || !(dev->features &NETIF_F_GRO )) {netif_rx (skb); -return ; + goto unlock; }if (skb_rx_queue_recorded (skb)) cell +=skb_get_rx_queue (skb) & gcells->gro_cells_mask;if (skb_queue_len (&cell->napi_skbs) > netdev_max_backlog) { +drop:atomic_long_inc (&dev->rx_dropped);kfree_skb (skb); -return ; + goto unlock; }/* We run in BH context */
@@ -42,6 +47,9 @@ static inline void gro_cells_receive(struct gro_cells *gcells, struct sk_buff *snapi_schedule (&cell->napi);spin_unlock (&cell->napi_skbs.lock); + +unlock: +rcu_read_unlock (); }/* called unser BH context */
include/net/icmp.h +8 -1
@@ -22,6 +22,7 @@#include <net/inet_sock.h> #include <net/snmp.h> +#include <net/ip.h> struct icmp_err {int errno;
@@ -39,7 +40,13 @@ struct net_proto_family;struct sk_buff ;struct net ; -void icmp_send (struct sk_buff *skb_in,int type,int code,__be32 info); +void __icmp_send (struct sk_buff *skb_in,int type,int code,__be32 info, +const struct ip_options *opt); +static inline void icmp_send (struct sk_buff *skb_in,int type,int code,__be32 info) +{ +__icmp_send (skb_in, type, code, info, &IPCB (skb_in)->opt); +} +int icmp_rcv (struct sk_buff *skb);void icmp_err (struct sk_buff *skb,u32 info);int icmp_init (void );
include/net/ip.h +2 -0
@@ -512,6 +512,8 @@ static inline int ip_options_echo(struct ip_options *dopt, struct sk_buff *skb) }void ip_options_fragment (struct sk_buff *skb); +int __ip_options_compile (struct net *net,struct ip_options *opt, +struct sk_buff *skb,__be32 *info);int ip_options_compile (struct net *net,struct ip_options *opt,struct sk_buff *skb); int ip_options_get(struct net *net, struct ip_options_rcu **optp,
kernel/sysctl.c +10 -1
@@ -2153,7 +2153,16 @@ static int do_proc_dointvec_minmax_conv(bool *negp, unsigned long *lvalp, {struct do_proc_dointvec_minmax_conv_param *param = data;if (write) { -int val = *negp ? -*lvalp : *lvalp; +int val; +if (*negp) { +if (*lvalp > (unsigned long )INT_MAX +1 ) +return -EINVAL ; + val = -*lvalp; + }else { +if (*lvalp > (unsigned long )INT_MAX ) +return -EINVAL ; + val = *lvalp; + }if ((param->min && *param->min > val) || (param->max && *param->max < val))return -EINVAL ;
lib/assoc_array.c +5 -3
@@ -780,9 +780,11 @@ all_leaves_cluster_together: new_s0->index_key[i] = ops->get_key_chunk (index_key, i *ASSOC_ARRAY_KEY_CHUNK_SIZE ); - blank =ULONG_MAX << (level &ASSOC_ARRAY_KEY_CHUNK_MASK ); -pr_devel ("blank off [%zu] %d: %lx\n" , keylen -1 , level, blank); - new_s0->index_key[keylen -1 ] &= ~blank; +if (level &ASSOC_ARRAY_KEY_CHUNK_MASK ) { + blank =ULONG_MAX << (level &ASSOC_ARRAY_KEY_CHUNK_MASK ); +pr_devel ("blank off [%zu] %d: %lx\n" , keylen -1 , level, blank); + new_s0->index_key[keylen -1 ] &= ~blank; + }/* This now reduces to a node splitting exercise for which we'll need * to regenerate the disparity table.
mm/hugetlb.c +12 -2
@@ -2938,7 +2938,6 @@ retry_avoidcopy:copy_user_huge_page (new_page, old_page, address, vma,pages_per_huge_page (h));__SetPageUptodate (new_page); -set_page_huge_active (new_page); mmun_start = address &huge_page_mask (h); mmun_end = mmun_start +huge_page_size (h);
@@ -2959,6 +2958,7 @@ retry_avoidcopy: make_huge_pte(vma, new_page, 1));page_remove_rmap (old_page);hugepage_add_new_anon_rmap (new_page, vma, address); +set_page_huge_active (new_page);/* Make the old page be freed below */ new_page = old_page; }
@@ -3017,6 +3017,7 @@ static int hugetlb_no_page(struct mm_struct *mm, struct vm_area_struct *vma,struct page *page;pte_t new_pte;spinlock_t *ptl; +bool new_page = false;/* * Currently, we are forced to kill the process in the event the
@@ -3050,7 +3051,7 @@ retry: }clear_huge_page (page, address,pages_per_huge_page (h));__SetPageUptodate (page); -set_page_huge_active (page); + new_page = true;if (vma->vm_flags &VM_MAYSHARE ) {int err;
@@ -3126,6 +3127,15 @@ retry: }spin_unlock (ptl); + +/* +* Only make newly allocated pages active. Existing pages found +* in the pagecache could be !page_huge_active() if they have been +* isolated for migration. +*/ +if (new_page) +set_page_huge_active (page); +unlock_page (page); out:return ret;
mm/memory_hotplug.c +2 -1
@@ -1321,7 +1321,8 @@ static struct page *next_active_pageblock(struct page *page)int is_mem_section_removable (unsigned long start_pfn,unsigned long nr_pages) {struct page *page =pfn_to_page (start_pfn); -struct page *end_page = page + nr_pages; +unsigned long end_pfn =min (start_pfn + nr_pages,zone_end_pfn (page_zone (page))); +struct page *end_page =pfn_to_page (end_pfn);/* Check the starting page of each pageblock within the range */ for (; page < end_page; page =next_active_pageblock (page)) {
mm/mempolicy.c +3 -3
@@ -1349,7 +1349,7 @@ static int copy_nodes_to_user(unsigned long __user *mask, unsigned long maxnode, nodemask_t *nodes) {unsigned long copy =ALIGN (maxnode-1 ,64 ) /8 ; -const int nbytes =BITS_TO_LONGS (MAX_NUMNODES ) *sizeof (long ); +unsigned int nbytes =BITS_TO_LONGS (nr_node_ids) *sizeof (long );if (copy > nbytes) {if (copy >PAGE_SIZE )
@@ -1510,7 +1510,7 @@ SYSCALL_DEFINE5(get_mempolicy, int __user *, policy,int uninitialized_var (pval );nodemask_t nodes; -if (nmask !=NULL && maxnode <MAX_NUMNODES ) +if (nmask !=NULL && maxnode < nr_node_ids)return -EINVAL ; err =do_get_mempolicy (&pval, &nodes, addr, flags);
@@ -1539,7 +1539,7 @@ COMPAT_SYSCALL_DEFINE5(get_mempolicy, int __user *, policy,unsigned long nr_bits, alloc_size;DECLARE_BITMAP (bm,MAX_NUMNODES ); - nr_bits = min_t(unsigned long, maxnode-1, MAX_NUMNODES); + nr_bits = min_t(unsigned long, maxnode-1, nr_node_ids); alloc_size =ALIGN (nr_bits,BITS_PER_LONG ) /8 ;if (nmask)
mm/migrate.c +11 -0
@@ -1050,6 +1050,16 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,lock_page (hpage); } +/* +* Check for pages which are in the process of being freed. Without +* page_mapping() set, hugetlbfs specific move page routine will not +* be called and we could leak usage counts for subpools. +*/ +if (page_private (hpage) && !page_mapping (hpage)) { + rc = -EBUSY ; + goto out_unlock; + } +if (PageAnon (hpage)) anon_vma =page_get_anon_vma (hpage);
@@ -1067,6 +1077,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,if (rc ==MIGRATEPAGE_SUCCESS )hugetlb_cgroup_migrate (hpage, new_hpage); +out_unlock:unlock_page (hpage); out:if (rc != -EAGAIN )
mm/mmap.c +3 -4
@@ -2292,12 +2292,11 @@ int expand_downwards(struct vm_area_struct *vma, {struct vm_area_struct *prev;unsigned long gap_addr; -int error; +int error =0 ; address &=PAGE_MASK ; - error =security_mmap_addr (address); -if (error) -return error; +if (address < mmap_min_addr) +return -EPERM ;/* Enforce stack_guard_gap */ gap_addr = address - stack_guard_gap;
mm/shmem.c +8 -4
@@ -2280,16 +2280,20 @@ static int shmem_create(struct inode *dir, struct dentry *dentry, umode_t mode,static int shmem_link (struct dentry *old_dentry,struct inode *dir,struct dentry *dentry) {struct inode *inode = old_dentry->d_inode; -int ret; +int ret =0 ;/* * No ordinary (disk based) filesystem counts links as inodes; * but each new link needs a new dentry, pinning lowmem, and * tmpfs dentries cannot be pruned until they are unlinked. +* But if an O_TMPFILE file is linked into the tmpfs, the +* first link must skip that, to get the accounting right. */ - ret =shmem_reserve_inode (inode->i_sb); -if (ret) - goto out; +if (inode->i_nlink) { + ret =shmem_reserve_inode (inode->i_sb); +if (ret) + goto out; + } dir->i_size +=BOGO_DIRENT_SIZE ; inode->i_ctime = dir->i_ctime = dir->i_mtime =CURRENT_TIME ;
mm/vmalloc.c +1 -1
@@ -2140,7 +2140,7 @@ int remap_vmalloc_range_partial(struct vm_area_struct *vma, unsigned long uaddr,if (!(area->flags &VM_USERMAP ))return -EINVAL ; -if (kaddr + size > area->addr + area->size) +if (kaddr + size > area->addr +get_vm_area_size (area))return -EINVAL ; do {
net/9p/client.c +1 -1
@@ -1065,7 +1065,7 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)p9_debug (P9_DEBUG_ERROR ,"Please specify a msize of at least 4k\n" ); err = -EINVAL ; - goto free_client; + goto close_trans; } err =p9_client_version (clnt);
net/batman-adv/soft-interface.c +2 -0
@@ -186,6 +186,8 @@ static int batadv_interface_tx(struct sk_buff *skb,switch (ntohs (ethhdr->h_proto)) {case ETH_P_8021Q : +if (!pskb_may_pull (skb,sizeof (*vhdr))) + goto dropped; vhdr =vlan_eth_hdr (skb);if (vhdr->h_vlan_encapsulated_proto != ethertype) {
net/ceph/messenger.c +8 -4
@@ -1980,15 +1980,19 @@ static int process_connect(struct ceph_connection *con)dout ("process_connect on %p tag %d\n" , con, (int )con->in_tag);if (con->auth_reply_buf) { +int len =le32_to_cpu (con->in_reply.authorizer_len); +/* * Any connection that defines ->get_authorizer() * should also define ->verify_authorizer_reply(). * See get_connect_authorizer(). */ - ret = con->ops->verify_authorizer_reply (con,0 ); -if (ret <0 ) { - con->error_msg ="bad authorize reply" ; -return ret; +if (len) { + ret = con->ops->verify_authorizer_reply (con,0 ); +if (ret <0 ) { + con->error_msg ="bad authorize reply" ; +return ret; + } } }
net/core/net-sysfs.c +3 -0
@@ -1241,6 +1241,9 @@ static int register_queue_kobjects(struct net_device *dev) error:netdev_queue_update_kobjects (dev, txq,0 );net_rx_queue_update_kobjects (dev, rxq,0 ); +#ifdef CONFIG_SYSFS +kset_unregister (dev->queues_kset); +#endif return error; }
net/hsr/hsr_device.c +9 -9
@@ -93,9 +93,8 @@ static void hsr_check_announce(struct net_device *hsr_dev,if ((hsr_dev->operstate ==IF_OPER_UP ) && (old_operstate !=IF_OPER_UP )) {/* Went up */ hsr->announce_count =0 ; - hsr->announce_timer.expires = jiffies + -msecs_to_jiffies (HSR_ANNOUNCE_INTERVAL ); -add_timer (&hsr->announce_timer); +mod_timer (&hsr->announce_timer, + jiffies +msecs_to_jiffies (HSR_ANNOUNCE_INTERVAL )); }if ((hsr_dev->operstate !=IF_OPER_UP ) && (old_operstate ==IF_OPER_UP ))
@@ -323,6 +322,7 @@ static void hsr_announce(unsigned long data) {struct hsr_priv *hsr;struct hsr_port *master; +unsigned long interval; hsr = (struct hsr_priv *) data;
@@ -337,14 +337,12 @@ static void hsr_announce(unsigned long data) }if (hsr->announce_count <3 ) - hsr->announce_timer.expires = jiffies + -msecs_to_jiffies (HSR_ANNOUNCE_INTERVAL ); + interval =msecs_to_jiffies (HSR_ANNOUNCE_INTERVAL );else - hsr->announce_timer.expires = jiffies + -msecs_to_jiffies (HSR_LIFE_CHECK_INTERVAL ); + interval =msecs_to_jiffies (HSR_LIFE_CHECK_INTERVAL );if (is_admin_up (master->dev)) -add_timer (&hsr->announce_timer); +mod_timer (&hsr->announce_timer, jiffies + interval);rcu_read_unlock (); }
@@ -474,7 +472,7 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], res =hsr_add_port (hsr, hsr_dev,HSR_PT_MASTER );if (res) -return res; + goto err_add_port; res =register_netdevice (hsr_dev);if (res)
@@ -495,6 +493,8 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], fail:hsr_for_each_port (hsr, port)hsr_del_port (port); +err_add_port: +hsr_del_node (&hsr->self_node_db);return res; }
net/hsr/hsr_framereg.c +12 -0
@@ -124,6 +124,18 @@ int hsr_create_self_node(struct list_head *self_node_db,return 0 ; } +void hsr_del_node (struct list_head *self_node_db) +{ +struct hsr_node *node; + +rcu_read_lock (); + node = list_first_or_null_rcu(self_node_db, struct hsr_node, mac_list); +rcu_read_unlock (); +if (node) { +list_del_rcu (&node->mac_list); +kfree (node); + } +}/* Allocate an hsr_node and add it to node_db. 'addr' is the node's AddressA; * seq_out is used to initialize filtering of outgoing duplicate frames
net/hsr/hsr_framereg.h +1 -0
@@ -16,6 +16,7 @@struct hsr_node ; +void hsr_del_node (struct list_head *self_node_db);struct hsr_node *hsr_add_node (struct list_head *node_db,unsigned char addr[],u16 seq_out); struct hsr_node *hsr_get_node(struct list_head *node_db, struct sk_buff *skb,
net/ipv4/cipso_ipv4.c +19 -4
@@ -165,7 +165,8 @@ static int cipso_v4_bitmap_walk(const unsigned char *bitmap, (state == 0 && (byte & bitmask) == 0))return bit_spot; - bit_spot++; +if (++bit_spot >= bitmap_len) +return -1 ; bitmask >>=1 ;if (bitmask ==0 ) { byte = bitmap[++byte_offset];
@@ -735,7 +736,8 @@ static int cipso_v4_map_lvl_valid(const struct cipso_v4_doi *doi_def, u8 level)case CIPSO_V4_MAP_PASS :return 0 ;case CIPSO_V4_MAP_TRANS : -if (doi_def->map.std->lvl.cipso[level] <CIPSO_V4_INV_LVL ) +if ((level < doi_def->map.std->lvl.cipso_size) && + (doi_def->map.std->lvl.cipso[level] <CIPSO_V4_INV_LVL ))return 0 ;break ; }
@@ -1803,13 +1805,26 @@ validate_return:*/ void cipso_v4_error (struct sk_buff *skb,int error,u32 gateway) { +unsigned char optbuf[sizeof (struct ip_options ) +40 ]; +struct ip_options *opt = (struct ip_options *)optbuf; +if (ip_hdr (skb)->protocol ==IPPROTO_ICMP || error != -EACCES )return ; +/* +* We might be called above the IP layer, +* so we can not use icmp_send and IPCB here. +*/ + +memset (opt,0 ,sizeof (struct ip_options )); + opt->optlen =ip_hdr (skb)->ihl*4 -sizeof (struct iphdr ); +if (__ip_options_compile (dev_net (skb->dev), opt, skb,NULL )) +return ; +if (gateway) -icmp_send (skb,ICMP_DEST_UNREACH ,ICMP_NET_ANO ,0 ); +__icmp_send (skb,ICMP_DEST_UNREACH ,ICMP_NET_ANO ,0 , opt);else -icmp_send (skb,ICMP_DEST_UNREACH ,ICMP_HOST_ANO ,0 ); +__icmp_send (skb,ICMP_DEST_UNREACH ,ICMP_HOST_ANO ,0 , opt); }/**
net/ipv4/icmp.c +4 -3
@@ -541,7 +541,8 @@ relookup_failed:* MUST reply to only the first fragment. */ -void icmp_send (struct sk_buff *skb_in,int type,int code,__be32 info) +void __icmp_send (struct sk_buff *skb_in,int type,int code,__be32 info, +const struct ip_options *opt) {struct iphdr *iph;int room;
@@ -655,7 +656,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) iph->tos; mark =IP4_REPLY_MARK (net, skb_in->mark); -if (ip_options_echo (&icmp_param->replyopts.opt.opt, skb_in)) +if (__ip_options_echo (&icmp_param->replyopts.opt.opt, skb_in, opt)) goto out_unlock;
@@ -707,7 +708,7 @@ out_free:kfree (icmp_param); out:; } -EXPORT_SYMBOL (icmp_send); +EXPORT_SYMBOL (__icmp_send);static void icmp_socket_deliver (struct sk_buff *skb,u32 info)
net/ipv4/ip_options.c +17 -5
@@ -253,8 +253,9 @@ static void spec_dst_fill(__be32 *spec_dst, struct sk_buff *skb)* If opt == NULL, then skb->data should point to IP header. */ -int ip_options_compile (struct net *net, -struct ip_options *opt,struct sk_buff *skb) +int __ip_options_compile (struct net *net, +struct ip_options *opt,struct sk_buff *skb, +__be32 *info) {__be32 spec_dst =htonl (INADDR_ANY );unsigned char *pp_ptr =NULL ;
@@ -470,11 +471,22 @@ eol:return 0 ; error: -if (skb) { -icmp_send (skb,ICMP_PARAMETERPROB ,0 ,htonl ((pp_ptr-iph)<<24 )); - } +if (info) + *info =htonl ((pp_ptr-iph)<<24 );return -EINVAL ; } + +int ip_options_compile (struct net *net, +struct ip_options *opt,struct sk_buff *skb) +{ +int ret; +__be32 info; + + ret =__ip_options_compile (net, opt, skb, &info); +if (ret !=0 && skb) +icmp_send (skb,ICMP_PARAMETERPROB ,0 , info); +return ret; +}EXPORT_SYMBOL (ip_options_compile);/*
net/ipv4/ip_vti.c +50 -0
80 lines not on this page · raw message
net/ipv6/ip6mr.c +4 -4
@@ -1987,10 +1987,10 @@ int ip6mr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg)static inline int ip6mr_forward2_finish (struct sk_buff *skb) { -IP6_INC_STATS_BH (dev_net (skb_dst (skb)->dev),ip6_dst_idev (skb_dst (skb)), -IPSTATS_MIB_OUTFORWDATAGRAMS ); -IP6_ADD_STATS_BH (dev_net (skb_dst (skb)->dev),ip6_dst_idev (skb_dst (skb)), -IPSTATS_MIB_OUTOCTETS , skb->len); +IP6_INC_STATS (dev_net (skb_dst (skb)->dev),ip6_dst_idev (skb_dst (skb)), +IPSTATS_MIB_OUTFORWDATAGRAMS ); +IP6_ADD_STATS (dev_net (skb_dst (skb)->dev),ip6_dst_idev (skb_dst (skb)), +IPSTATS_MIB_OUTOCTETS , skb->len);return dst_output (skb); }
net/ipv6/route.c +1 -1
@@ -2558,7 +2558,7 @@ static int rt6_fill_node(struct net *net, table = rt->rt6i_table->tb6_id; else table =RT6_TABLE_UNSPEC ; - rtm->rtm_table = table; + rtm->rtm_table = table <256 ? table :RT_TABLE_COMPAT ;if (nla_put_u32 (skb,RTA_TABLE , table)) goto nla_put_failure;if (rt->rt6i_flags &RTF_REJECT ) {
net/ipv6/sit.c +4 -3
@@ -577,7 +577,7 @@ static int ipip6_err(struct sk_buff *skb, u32 info) goto out; err =0 ; -if (!ipip6_err_gen_icmpv6_unreach (skb)) +if (__in6_dev_get (skb->dev) && !ipip6_err_gen_icmpv6_unreach (skb)) goto out;if (t->parms.iph.ttl ==0 && type ==ICMP_TIME_EXCEEDED )
@@ -771,8 +771,9 @@ static bool check_6rd(struct ip_tunnel *tunnel, const struct in6_addr *v6dst, pbw0 = tunnel->ip6rd.prefixlen >>5 ; pbi0 = tunnel->ip6rd.prefixlen &0x1f ; - d = (ntohl (v6dst->s6_addr32[pbw0]) << pbi0) >> - tunnel->ip6rd.relay_prefixlen; + d = tunnel->ip6rd.relay_prefixlen <32 ? + (ntohl (v6dst->s6_addr32[pbw0]) << pbi0) >> + tunnel->ip6rd.relay_prefixlen :0 ; pbi1 = pbi0 - tunnel->ip6rd.relay_prefixlen;if (pbi1 >0 )
net/l2tp/l2tp_ip6.c +1 -3
@@ -666,9 +666,6 @@ static int l2tp_ip6_recvmsg(struct kiocb *iocb, struct sock *sk,if (flags &MSG_OOB ) goto out; -if (addr_len) - *addr_len =sizeof (*lsa); -if (flags &MSG_ERRQUEUE )return ipv6_recv_error (sk, msg, len, addr_len);
@@ -698,6 +695,7 @@ static int l2tp_ip6_recvmsg(struct kiocb *iocb, struct sock *sk, lsa->l2tp_conn_id =0 ;if (ipv6_addr_type (&lsa->l2tp_addr) &IPV6_ADDR_LINKLOCAL ) lsa->l2tp_scope_id =inet6_iif (skb); + *addr_len =sizeof (*lsa); }if (np->rxopt.all)
net/mac80211/cfg.c +4 -0
@@ -1194,6 +1194,10 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, sta->sta.tdls = true; } +if (sta->sta.tdls && sdata->vif.type ==NL80211_IFTYPE_STATION && + !sdata->u.mgd.associated) +return -EINVAL ; + err =sta_apply_parameters (local, sta, params);if (err) {sta_info_free (local, sta);
net/mac80211/rx.c +3 -1
@@ -2179,7 +2179,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)skb_set_queue_mapping (skb, q);if (!--mesh_hdr->ttl) { -IEEE80211_IFSTA_MESH_CTR_INC (ifmsh, dropped_frames_ttl); +if (!is_multicast_ether_addr (hdr->addr1)) +IEEE80211_IFSTA_MESH_CTR_INC (ifmsh, + dropped_frames_ttl); goto out; }
net/netfilter/ipvs/ip_vs_ctl.c +12 -0
@@ -2182,6 +2182,18 @@ static int ip_vs_set_timeout(struct net *net, struct ip_vs_timeout_user *u) u->tcp_fin_timeout, u->udp_timeout); +#ifdef CONFIG_IP_VS_PROTO_TCP +if (u->tcp_timeout <0 || u->tcp_timeout > (INT_MAX /HZ ) || + u->tcp_fin_timeout <0 || u->tcp_fin_timeout > (INT_MAX /HZ )) { +return -EINVAL ; + } +#endif + +#ifdef CONFIG_IP_VS_PROTO_UDP +if (u->udp_timeout <0 || u->udp_timeout > (INT_MAX /HZ )) +return -EINVAL ; +#endif +#ifdef CONFIG_IP_VS_PROTO_TCP if (u->tcp_timeout) { pd =ip_vs_proto_data_get (net,IPPROTO_TCP );
net/netlink/af_netlink.c +22 -12
@@ -1977,6 +1977,7 @@ static int netlink_dump(struct sock *sk)struct nlmsghdr *nlh;struct module *module;int err = -ENOBUFS ; +int alloc_min_size;int alloc_size;mutex_lock (nlk->cb_mutex);
@@ -1985,9 +1986,6 @@ static int netlink_dump(struct sock *sk) goto errout_skb; } - cb = &nlk->cb; - alloc_size =max_t (int, cb->min_dump_alloc,NLMSG_GOODSIZE ); -if (atomic_read (&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) goto errout_skb;
@@ -1996,22 +1994,34 @@ static int netlink_dump(struct sock *sk)* to reduce number of system calls on dump operations, if user * ever provided a big enough buffer. */ -if (alloc_size < nlk->max_recvmsg_len) { - skb =netlink_alloc_skb (sk, - nlk->max_recvmsg_len, - nlk->portid, + cb = &nlk->cb; + alloc_min_size =max_t (int, cb->min_dump_alloc,NLMSG_GOODSIZE ); + +if (alloc_min_size < nlk->max_recvmsg_len) { + alloc_size = nlk->max_recvmsg_len; + skb =netlink_alloc_skb (sk, alloc_size, nlk->portid, (GFP_KERNEL & ~__GFP_WAIT) | __GFP_NOWARN | __GFP_NORETRY); -/* available room should be exact amount to avoid MSG_TRUNC */ -if (skb) -skb_reserve (skb,skb_tailroom (skb) - - nlk->max_recvmsg_len); } -if (!skb) +if (!skb) { + alloc_size = alloc_min_size; skb =netlink_alloc_skb (sk, alloc_size, nlk->portid, (GFP_KERNEL & ~__GFP_WAIT)); + }if (!skb) goto errout_skb; + +/* Trim skb to allocated size. User is expected to provide buffer as +* large as max(min_dump_alloc, 16KiB (mac_recvmsg_len capped at +* netlink_recvmsg())). dump will pack as many smaller messages as +* could fit within the allocated skb. skb is typically allocated +* with larger space than required (could be as much as near 2x the +* requested size with align to next power of 2 approach). Allowing +* dump to use the excess space makes it difficult for a user to have a +* reasonable static buffer based on the expected largest dump of a +* single netdev. The outcome is MSG_TRUNC error. +*/ +skb_reserve (skb,skb_tailroom (skb) - alloc_size);netlink_skb_set_owner_r (skb, sk);if (nlk->dump_done_errno >0 )
net/nfc/llcp_commands.c +20 -0
@@ -418,6 +418,10 @@ int nfc_llcp_send_connect(struct nfc_llcp_sock *sock) sock->service_name, sock->service_name_len, &service_name_tlv_length); +if (!service_name_tlv) { + err = -ENOMEM ; + goto error_tlv; + } size += service_name_tlv_length; }
@@ -428,9 +432,17 @@ int nfc_llcp_send_connect(struct nfc_llcp_sock *sock) miux_tlv =nfc_llcp_build_tlv (LLCP_TLV_MIUX , (u8 *)&miux,0 , &miux_tlv_length); +if (!miux_tlv) { + err = -ENOMEM ; + goto error_tlv; + } size += miux_tlv_length; rw_tlv =nfc_llcp_build_tlv (LLCP_TLV_RW , &rw,0 , &rw_tlv_length); +if (!rw_tlv) { + err = -ENOMEM ; + goto error_tlv; + } size += rw_tlv_length;pr_debug ("SKB size %d SN length %zu\n" , size, sock->service_name_len);
@@ -484,9 +496,17 @@ int nfc_llcp_send_cc(struct nfc_llcp_sock *sock) miux_tlv =nfc_llcp_build_tlv (LLCP_TLV_MIUX , (u8 *)&miux,0 , &miux_tlv_length); +if (!miux_tlv) { + err = -ENOMEM ; + goto error_tlv; + } size += miux_tlv_length; rw_tlv =nfc_llcp_build_tlv (LLCP_TLV_RW , &rw,0 , &rw_tlv_length); +if (!rw_tlv) { + err = -ENOMEM ; + goto error_tlv; + } size += rw_tlv_length; skb =llcp_allocate_pdu (sock,LLCP_PDU_CC , size);
net/nfc/llcp_core.c +20 -4
@@ -531,10 +531,10 @@ static u8 nfc_llcp_reserve_sdp_ssap(struct nfc_llcp_local *local)static int nfc_llcp_build_gb (struct nfc_llcp_local *local) { -u8 *gb_cur, *version_tlv, version, version_length; -u8 *lto_tlv, lto_length; -u8 *wks_tlv, wks_length; -u8 *miux_tlv, miux_length; +u8 *gb_cur, version, version_length; +u8 lto_length, wks_length, miux_length; +u8 *version_tlv =NULL , *lto_tlv =NULL , + *wks_tlv =NULL , *miux_tlv =NULL ;__be16 wks =cpu_to_be16 (local->local_wks);u8 gb_len =0 ;int ret =0 ;
@@ -542,17 +542,33 @@ static int nfc_llcp_build_gb(struct nfc_llcp_local *local) version =LLCP_VERSION_11 ; version_tlv =nfc_llcp_build_tlv (LLCP_TLV_VERSION , &version,1 , &version_length); +if (!version_tlv) { + ret = -ENOMEM ; + goto out; + } gb_len += version_length; lto_tlv =nfc_llcp_build_tlv (LLCP_TLV_LTO , &local->lto,1 , <o_length); +if (!lto_tlv) { + ret = -ENOMEM ; + goto out; + } gb_len += lto_length;pr_debug ("Local wks 0x%lx\n" , local->local_wks); wks_tlv =nfc_llcp_build_tlv (LLCP_TLV_WKS , (u8 *)&wks,2 , &wks_length); +if (!wks_tlv) { + ret = -ENOMEM ; + goto out; + } gb_len += wks_length; miux_tlv =nfc_llcp_build_tlv (LLCP_TLV_MIUX , (u8 *)&local->miux,0 , &miux_length); +if (!miux_tlv) { + ret = -ENOMEM ; + goto out; + } gb_len += miux_length; gb_len +=ARRAY_SIZE (llcp_magic);
net/packet/af_packet.c +1 -1
@@ -3894,7 +3894,7 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u, rb->frames_per_block = req->tp_block_size/req->tp_frame_size;if (unlikely (rb->frames_per_block <=0 )) goto out; -if (unlikely (req->tp_block_size >UINT_MAX / req->tp_block_nr)) +if (unlikely (rb->frames_per_block >UINT_MAX / req->tp_block_nr)) goto out;if (unlikely ((rb->frames_per_block * req->tp_block_nr) != req->tp_frame_nr))
net/unix/af_unix.c +29 -19
102 lines not on this page · raw message
net/unix/diag.c +2 -1
@@ -10,7 +10,8 @@static int sk_diag_dump_name (struct sock *sk,struct sk_buff *nlskb) { -struct unix_address *addr =unix_sk (sk)->addr; +/* might or might not have unix_table_lock */ +struct unix_address *addr =smp_load_acquire (&unix_sk (sk)->addr);if (!addr)return 0 ;
net/wireless/reg.c +2 -2
@@ -688,7 +688,7 @@ static bool reg_does_bw_fit(const struct ieee80211_freq_range *freq_range,* definitions (the "2.4 GHz band", the "5 GHz band" and the "60GHz band"), * however it is safe for now to assume that a frequency rule should not be * part of a frequency's band if the start freq or end freq are off by more -* than 2 GHz for the 2.4 and 5 GHz bands, and by more than 10 GHz for the +* than 2 GHz for the 2.4 and 5 GHz bands, and by more than 20 GHz for the * 60 GHz band. * This resolution can be lowered and should be considered as we add * regulatory rule support for other "bands".
@@ -703,7 +703,7 @@ static bool freq_in_rule_band(const struct ieee80211_freq_range *freq_range,* with the Channel starting frequency above 45 GHz. */ u32 limit = freq_khz >45 *ONE_GHZ_IN_KHZ ? -10 *ONE_GHZ_IN_KHZ :2 *ONE_GHZ_IN_KHZ ; +20 *ONE_GHZ_IN_KHZ :2 *ONE_GHZ_IN_KHZ ;if (abs (freq_khz - freq_range->start_freq_khz) <= limit)return true;if (abs (freq_khz - freq_range->end_freq_khz) <= limit)
net/x25/af_x25.c +14 -6
@@ -678,8 +678,7 @@ static int x25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)struct sockaddr_x25 *addr = (struct sockaddr_x25 *)uaddr;int len, i, rc =0 ; -if (!sock_flag (sk,SOCK_ZAPPED ) || - addr_len !=sizeof (struct sockaddr_x25 ) || +if (addr_len !=sizeof (struct sockaddr_x25 ) || addr->sx25_family !=AF_X25 ) { rc = -EINVAL ; goto out;
@@ -694,9 +693,13 @@ static int x25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) }lock_sock (sk); -x25_sk (sk)->source_addr = addr->sx25_addr; -x25_insert_socket (sk); -sock_reset_flag (sk,SOCK_ZAPPED ); +if (sock_flag (sk,SOCK_ZAPPED )) { +x25_sk (sk)->source_addr = addr->sx25_addr; +x25_insert_socket (sk); +sock_reset_flag (sk,SOCK_ZAPPED ); + }else { + rc = -EINVAL ; + }release_sock (sk);SOCK_DEBUG (sk,"x25_bind: socket is bound\n" ); out:
@@ -812,8 +815,13 @@ static int x25_connect(struct socket *sock, struct sockaddr *uaddr, sock->state =SS_CONNECTED ; rc =0 ; out_put_neigh: -if (rc) +if (rc) { +read_lock_bh (&x25_list_lock);x25_neigh_put (x25->neighbour); + x25->neighbour =NULL ; +read_unlock_bh (&x25_list_lock); + x25->state =X25_STATE_0 ; + } out_put_route:x25_route_put (rt); out:
security/keys/key.c +2 -2
@@ -260,8 +260,8 @@ struct key *key_alloc(struct key_type *type, const char *desc,spin_lock (&user->lock);if (!(flags &KEY_ALLOC_QUOTA_OVERRUN )) { -if (user->qnkeys +1 >= maxkeys || - user->qnbytes + quotalen >= maxbytes || +if (user->qnkeys +1 > maxkeys || + user->qnbytes + quotalen > maxbytes || user->qnbytes + quotalen < user->qnbytes) goto no_quota; }
security/keys/keyring.c +1 -3
@@ -628,9 +628,6 @@ static bool search_nested_keyrings(struct key *keyring,BUG_ON ((ctx->flags &STATE_CHECKS ) ==0 || (ctx->flags &STATE_CHECKS ) ==STATE_CHECKS ); -if (ctx->index_key.description) - ctx->index_key.desc_len =strlen (ctx->index_key.description); -/* Check to see if this top-level keyring is what we are looking for * and whether it is valid or not. */
@@ -888,6 +885,7 @@ key_ref_t keyring_search(key_ref_t keyring,struct keyring_search_context ctx = { .index_key.type = type, .index_key.description = description, + .index_key.desc_len =strlen (description), .cred =current_cred (), .match_data.cmp = key_default_cmp, .match_data.raw_data = description,
security/keys/proc.c +1 -2
@@ -191,8 +191,7 @@ static int proc_keys_show(struct seq_file *m, void *v)int rc;struct keyring_search_context ctx = { - .index_key.type = key->type, - .index_key.description = key->description, + .index_key = key->index_key, .cred =current_cred (), .match_data.cmp = lookup_user_key_possessed, .match_data.raw_data = key,
security/keys/request_key.c +1 -0
@@ -544,6 +544,7 @@ struct key *request_key_and_link(struct key_type *type,struct keyring_search_context ctx = { .index_key.type = type, .index_key.description = description, + .index_key.desc_len =strlen (description), .cred =current_cred (), .match_data.cmp = key_default_cmp, .match_data.raw_data = description,
security/keys/request_key_auth.c +1 -1
@@ -254,7 +254,7 @@ struct key *key_get_instantiation_authkey(key_serial_t target_id)struct key *authkey;key_ref_t authkey_ref; -sprintf (description,"%x" , target_id); + ctx.index_key.desc_len =sprintf (description,"%x" , target_id); authkey_ref =search_process_keyrings (&ctx);
security/lsm_audit.c +6 -4
@@ -290,6 +290,7 @@ static void dump_common_audit_data(struct audit_buffer *ab,if (a->u.net->sk) {struct sock *sk = a->u.net->sk;struct unix_sock *u; +struct unix_address *addr;int len =0 ;char *p =NULL ;
@@ -320,14 +321,15 @@ static void dump_common_audit_data(struct audit_buffer *ab,#endif case AF_UNIX : u =unix_sk (sk); + addr =smp_load_acquire (&u->addr); +if (!addr) +break ;if (u->path.dentry) {audit_log_d_path (ab," path=" , &u->path);break ; } -if (!u->addr) -break ; - len = u->addr->len-sizeof (short ); - p = &u->addr->name->sun_path[0 ]; + len = addr->len-sizeof (short ); + p = &addr->name->sun_path[0 ];audit_log_format (ab," path=" );if (*p)audit_log_untrustedstring (ab, p);
sound/core/compress_offload.c +2 -1
@@ -500,7 +500,8 @@ static int snd_compress_check_input(struct snd_compr_params *params) {/* first let's check the buffer parameter's */ if (params->buffer.fragment_size ==0 || - params->buffer.fragments >INT_MAX / params->buffer.fragment_size) + params->buffer.fragments >INT_MAX / params->buffer.fragment_size || + params->buffer.fragments ==0 )return -EINVAL ;/* now codec parameters */
sound/firewire/bebob/bebob.c +13 -1
@@ -396,7 +396,19 @@ static const struct ieee1394_device_id bebob_id_table[] = {/* Focusrite, SaffirePro 26 I/O */ SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, 0x00000003, &saffirepro_26_spec), /* Focusrite, SaffirePro 10 I/O */ -SND_BEBOB_DEV_ENTRY (VEN_FOCUSRITE ,0x00000006 , &saffirepro_10_spec), + { +// The combination of vendor_id and model_id is the same as the +// same as the one of Liquid Saffire 56. + .match_flags =IEEE1394_MATCH_VENDOR_ID | +IEEE1394_MATCH_MODEL_ID | +IEEE1394_MATCH_SPECIFIER_ID | + IEEE1394_MATCH_VERSION, + .vendor_id = VEN_FOCUSRITE, + .model_id = 0x000006, + .specifier_id = 0x00a02d, + .version = 0x010001, + .driver_data = (kernel_ulong_t)&saffirepro_10_spec, + },/* Focusrite, Saffire(no label and LE) */ SND_BEBOB_DEV_ENTRY (VEN_FOCUSRITE ,MODEL_FOCUSRITE_SAFFIRE_BOTH , &saffire_spec),
sound/soc/fsl/fsl_esai.c +4 -3
@@ -394,7 +394,8 @@ static int fsl_esai_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)break ;case SND_SOC_DAIFMT_RIGHT_J :/* Data on rising edge of bclk, frame high, right aligned */ - xccr |= ESAI_xCCR_xCKP | ESAI_xCCR_xHCKP | ESAI_xCR_xWA; + xccr |= ESAI_xCCR_xCKP | ESAI_xCCR_xHCKP; + xcr |= ESAI_xCR_xWA;break ;case SND_SOC_DAIFMT_DSP_A :/* Data on rising edge of bclk, frame high, 1clk before data */
@@ -451,12 +452,12 @@ static int fsl_esai_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)return -EINVAL ; } - mask = ESAI_xCR_xFSL | ESAI_xCR_xFSR; + mask = ESAI_xCR_xFSL | ESAI_xCR_xFSR | ESAI_xCR_xWA;regmap_update_bits (esai_priv->regmap,REG_ESAI_TCR , mask, xcr);regmap_update_bits (esai_priv->regmap,REG_ESAI_RCR , mask, xcr); mask = ESAI_xCCR_xCKP | ESAI_xCCR_xHCKP | ESAI_xCCR_xFSP | - ESAI_xCCR_xFSD | ESAI_xCCR_xCKD | ESAI_xCR_xWA; + ESAI_xCCR_xFSD | ESAI_xCCR_xCKD;regmap_update_bits (esai_priv->regmap,REG_ESAI_TCCR , mask, xccr);regmap_update_bits (esai_priv->regmap,REG_ESAI_RCCR , mask, xccr);
sound/soc/fsl/imx-audmux.c +12 -12
@@ -86,49 +86,49 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,if (!buf)return -ENOMEM ; - ret =snprintf (buf,PAGE_SIZE ,"PDCR: %08x\nPTCR: %08x\n" , + ret =scnprintf (buf,PAGE_SIZE ,"PDCR: %08x\nPTCR: %08x\n" , pdcr, ptcr);if (ptcr &IMX_AUDMUX_V2_PTCR_TFSDIR ) - ret +=snprintf (buf + ret,PAGE_SIZE - ret, + ret +=scnprintf (buf + ret,PAGE_SIZE - ret,"TxFS output from %s, " ,audmux_port_string ((ptcr >>27 ) &0x7 ));else - ret +=snprintf (buf + ret,PAGE_SIZE - ret, + ret +=scnprintf (buf + ret,PAGE_SIZE - ret,"TxFS input, " );if (ptcr &IMX_AUDMUX_V2_PTCR_TCLKDIR ) - ret +=snprintf (buf + ret,PAGE_SIZE - ret, + ret +=scnprintf (buf + ret,PAGE_SIZE - ret,"TxClk output from %s" ,audmux_port_string ((ptcr >>22 ) &0x7 ));else - ret +=snprintf (buf + ret,PAGE_SIZE - ret, + ret +=scnprintf (buf + ret,PAGE_SIZE - ret,"TxClk input" ); - ret +=snprintf (buf + ret,PAGE_SIZE - ret,"\n" ); + ret +=scnprintf (buf + ret,PAGE_SIZE - ret,"\n" );if (ptcr &IMX_AUDMUX_V2_PTCR_SYN ) { - ret +=snprintf (buf + ret,PAGE_SIZE - ret, + ret +=scnprintf (buf + ret,PAGE_SIZE - ret,"Port is symmetric" ); }else {if (ptcr &IMX_AUDMUX_V2_PTCR_RFSDIR ) - ret +=snprintf (buf + ret,PAGE_SIZE - ret, + ret +=scnprintf (buf + ret,PAGE_SIZE - ret,"RxFS output from %s, " ,audmux_port_string ((ptcr >>17 ) &0x7 ));else - ret +=snprintf (buf + ret,PAGE_SIZE - ret, + ret +=scnprintf (buf + ret,PAGE_SIZE - ret,"RxFS input, " );if (ptcr &IMX_AUDMUX_V2_PTCR_RCLKDIR ) - ret +=snprintf (buf + ret,PAGE_SIZE - ret, + ret +=scnprintf (buf + ret,PAGE_SIZE - ret,"RxClk output from %s" ,audmux_port_string ((ptcr >>12 ) &0x7 ));else - ret +=snprintf (buf + ret,PAGE_SIZE - ret, + ret +=scnprintf (buf + ret,PAGE_SIZE - ret,"RxClk input" ); } - ret +=snprintf (buf + ret,PAGE_SIZE - ret, + ret +=scnprintf (buf + ret,PAGE_SIZE - ret,"\nData received from %s\n" ,audmux_port_string ((pdcr >>13 ) &0x7 ));
sound/soc/intel/broadwell.c +1 -1
@@ -168,7 +168,7 @@ static struct snd_soc_dai_link broadwell_rt286_dais[] = { .stream_name = "Loopback", .cpu_dai_name = "Loopback Pin", .platform_name = "haswell-pcm-audio", - .dynamic = 0, + .dynamic = 1, .codec_name = "snd-soc-dummy", .codec_dai_name = "snd-soc-dummy-dai", .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
sound/soc/intel/haswell.c +1 -1
@@ -146,7 +146,7 @@ static struct snd_soc_dai_link haswell_rt5640_dais[] = { .stream_name = "Loopback", .cpu_dai_name = "Loopback Pin", .platform_name = "haswell-pcm-audio", - .dynamic = 0, + .dynamic = 1, .codec_name = "snd-soc-dummy", .codec_dai_name = "snd-soc-dummy-dai", .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
tools/perf/util/cpumap.c +9 -2
@@ -121,7 +121,12 @@ struct cpu_map *cpu_map__new(const char *cpu_list)if (!cpu_list)return cpu_map__read_all_cpu_map (); -if (!isdigit (*cpu_list)) +/* +* must handle the case of empty cpumap to cover +* TOPOLOGY header for NUMA nodes with no CPU +* ( e.g., because of CPU hotplug) +*/ +if (!isdigit (*cpu_list) && *cpu_list !='\0' ) goto out;while (isdigit (*cpu_list)) {
@@ -168,8 +173,10 @@ struct cpu_map *cpu_map__new(const char *cpu_list)if (nr_cpus >0 ) cpus =cpu_map__trim_new (nr_cpus, tmp_cpus); -else +else if (*cpu_list !='\0' ) cpus =cpu_map__default_new (); +else + cpus =cpu_map__dummy_new (); invalid:free (tmp_cpus); out:
tools/perf/util/symbol-elf.c +8 -1
@@ -48,6 +48,11 @@ static inline uint8_t elf_sym__type(const GElf_Sym *sym)return GELF_ST_TYPE (sym->st_info); } +static inline uint8_t elf_sym__visibility (const GElf_Sym *sym) +{ +return GELF_ST_VISIBILITY (sym->st_other); +} +#ifndef STT_GNU_IFUNC #define STT_GNU_IFUNC 10#endif
@@ -72,7 +77,9 @@ static inline int elf_sym__is_label(const GElf_Sym *sym)return elf_sym__type (sym) ==STT_NOTYPE && sym->st_name !=0 && sym->st_shndx !=SHN_UNDEF && - sym->st_shndx !=SHN_ABS ; + sym->st_shndx !=SHN_ABS && +elf_sym__visibility (sym) !=STV_HIDDEN && +elf_sym__visibility (sym) !=STV_INTERNAL ; }static bool elf_sym__is_a (GElf_Sym *sym,enum map_type type)