Linux 4.4.167
Greg KH
maintainerI'm announcing the release of the 4.4.167 kernel.
All users of the 4.4 kernel series must upgrade.
The updated 4.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.4.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 | 5 + arch/arc/Kconfig | 2 arch/arc/Makefile | 2 arch/arc/configs/axs101_defconfig | 2 arch/arc/configs/axs103_defconfig | 1 arch/arc/configs/axs103_smp_defconfig | 1 arch/arc/configs/nsim_700_defconfig | 1 arch/arc/configs/nsimosci_defconfig | 2 arch/arc/configs/nsimosci_hs_defconfig | 1 arch/arc/configs/nsimosci_hs_smp_defconfig | 1 arch/arc/configs/tb10x_defconfig | 1 arch/arc/configs/vdk_hs38_defconfig | 1 arch/arc/configs/vdk_hs38_smp_defconfig | 1 arch/mips/include/asm/syscall.h | 2 arch/mips/ralink/mt7620.c | 2 arch/x86/kvm/mmu.c | 27 ++------ arch/xtensa/kernel/asm-offsets.c | 16 ++--- arch/xtensa/kernel/process.c | 5 + drivers/dma/at_hdmac.c | 10 ++- drivers/gpu/drm/ast/ast_main.c | 3 drivers/gpu/drm/gma500/mdfld_intel_display.c | 2 drivers/infiniband/ulp/iser/iser_verbs.c | 7 -- drivers/input/joystick/xpad.c | 16 +---- drivers/input/keyboard/matrix_keypad.c | 23 ++++--- drivers/input/mouse/elan_i2c_core.c | 3 drivers/iommu/intel-iommu.c | 2 drivers/iommu/intel-svm.c | 2 drivers/iommu/ipmmu-vmsa.c | 3 drivers/leds/led-class.c | 5 - drivers/leds/leds-gpio.c | 4 - drivers/leds/leds-pwm.c | 1 drivers/media/usb/em28xx/em28xx-dvb.c | 3 drivers/misc/mic/scif/scif_rma.c | 2 drivers/net/can/rcar_can.c | 5 + drivers/net/ethernet/amd/sunlance.c | 4 - drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 7 ++ drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 1 drivers/net/ethernet/faraday/ftmac100.c | 7 -- drivers/net/ethernet/mellanox/mlx4/alloc.c | 2 drivers/net/ethernet/mellanox/mlx4/mlx4.h | 4 - drivers/net/ethernet/mellanox/mlx4/mr.c | 1 drivers/net/ethernet/qlogic/qed/qed_int.c | 2 drivers/net/ethernet/qlogic/qed/qed_main.c | 2 drivers/net/rionet.c | 2 drivers/net/usb/ipheth.c | 10 +-- drivers/net/wireless/mac80211_hwsim.c | 8 +- drivers/net/wireless/ti/wlcore/cmd.c | 6 - drivers/s390/net/qeth_core_main.c | 27 +++----- drivers/s390/virtio/virtio_ccw.c | 17 ++++- drivers/scsi/bfa/bfa_fcbuild.c | 8 +- drivers/scsi/bfa/bfa_fcs.c | 78 ++++++++++++------------ drivers/scsi/bfa/bfa_fcs_lport.c | 62 +++++++------------ drivers/scsi/bfa/bfa_ioc.c | 2 drivers/scsi/bfa/bfa_svc.c | 4 - drivers/scsi/bfa/bfad.c | 20 +++--- drivers/scsi/bfa/bfad_attr.c | 2 drivers/scsi/bfa/bfad_bsg.c | 6 - drivers/scsi/csiostor/csio_lnode.c | 43 ++++++++----- drivers/scsi/scsi_devinfo.c | 22 ++---- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 drivers/staging/rts5208/sd.c | 6 - drivers/tty/serial/8250/8250_mtk.c | 16 ++--- drivers/tty/serial/kgdboc.c | 47 +++++++------- drivers/usb/core/hub.c | 2 drivers/usb/core/quirks.c | 7 ++ drivers/usb/core/usb.c | 6 - drivers/usb/gadget/udc/dummy_hcd.c | 9 +- drivers/usb/host/hwa-hc.c | 2 drivers/usb/host/xhci.c | 16 +++++ drivers/usb/misc/appledisplay.c | 1 drivers/usb/storage/unusual_realtek.h | 10 +++ fs/btrfs/disk-io.c | 10 --- fs/btrfs/free-space-cache.c | 2 fs/btrfs/super.c | 1 fs/btrfs/transaction.c | 6 - fs/cifs/dir.c | 2 fs/exec.c | 7 -- fs/ext2/xattr.c | 2 fs/kernfs/symlink.c | 2 include/linux/sched.h | 7 +- include/linux/usb.h | 4 - include/sound/pcm_params.h | 4 - kernel/debug/kdb/kdb_support.c | 4 - kernel/events/uprobes.c | 12 +++ lib/kobject.c | 2 mm/mlock.c | 3 mm/truncate.c | 8 +- net/batman-adv/fragmentation.c | 2 net/ipv4/ip_tunnel.c | 4 - net/mac80211/iface.c | 2 net/mac80211/rx.c | 1 net/mac80211/status.c | 2 net/mac80211/tx.c | 4 - net/sunrpc/auth_gss/auth_gss.c | 4 + scripts/Makefile.extrawarn | 3 scripts/unifdef.c | 4 - sound/core/control.c | 80 ++++++++++++++----------- sound/core/pcm_native.c | 14 ++-- sound/isa/wss/wss_lib.c | 2 sound/pci/ac97/ac97_codec.c | 2 sound/pci/hda/hda_intel.c | 4 + sound/pci/trident/trident.c | 2 sound/sparc/cs4231.c | 8 -- sound/usb/card.c | 5 + 104 files changed, 474 insertions(+), 380 deletions(-)
Adam Wong (1):
Input: elan_i2c - add support for ELAN0621 touchpad
Alexander Theissen (1):
usb: appledisplay: Add 27" Apple Cinema Display
Alexey Brodkin (1):
arc: [devboards] Add support of NFSv3 ACL
Andrea Parri (1):
uprobes: Fix handle_swbp() vs. unregister() + register() race once more
Arnd Bergmann (6):
exec: avoid gcc-8 warning for get_task_comm
drm: gma500: fix logic error
scsi: bfa: convert to strlcpy/strlcat
staging: rts5208: fix gcc-8 logic error warning
kdb: use memmove instead of overlapping memcpy
usb: gadget: dummy: fix nonsensical comparisons
Aya Levin (1):
net/mlx4: Fix UBSAN warning of signed integer overflow
Ben Greear (1):
mac80211: Clear beacon_int in ieee80211_do_stop
Bernd Eckstein (1):
usbnet: ipheth: fix potential recvmsg bug and recvmsg bug 2
Cameron Gutman (1):
Input: xpad - quirk all PDP Xbox One gamepads
Chanho Min (1):
ALSA: pcm: Fix starvation on down_write_nonblock()
Christian Hoff (1):
Input: matrix_keypad - check for errors from of_get_named_gpio()
Chuck Lever (1):
SUNRPC: Fix leak of krb5p encode pages
Denis Bolotin (2):
qed: Fix PTT leak in qed_drain()
qed: Fix reading wrong value in loop condition
Dmitry V. Levin (1):
mips: fix mips_get_syscall_arg o32 check
Emmanuel Grumbach (1):
mac80211: ignore NullFunc frames in the duplicate detection
Fabrizio Castro (1):
can: rcar_can: Fix erroneous registration
Felix Fietkau (2):
mac80211: ignore tx status for PS stations in ieee80211_tx_status_ext
mac80211: fix reordering of buffered broadcast packets
Filipe Manana (2):
Btrfs: ensure path name is null terminated at btrfs_control_ioctl
Btrfs: fix use-after-free when dumping free space
Geert Uytterhoeven (1):
iommu/ipmmu-vmsa: Fix crash on early domain free
Greg Kroah-Hartman (2):
Staging: lustre: remove two build warnings
Linux 4.4.167
Guenter Roeck (2):
kobject: Replace strncpy with memcpy
kernfs: Replace strncpy with memcpy
Halil Pasic (2):
virtio/s390: avoid race on vcdev->config
virtio/s390: fix race in ccw_io_helper()
Harry Pan (1):
usb: quirk: add no-LPM quirk on SanDisk Ultra Flair device
Hui Peng (1):
ALSA: usb-audio: Fix UAF decrement if card has no live interfaces in card.c
Jack Morgenstein (1):
net/mlx4_core: Zero out lkey field in SW2HW_MPT fw command
Josef Bacik (1):
btrfs: release metadata before running delayed refs
Julian Wiedmann (1):
s390/qeth: fix length check in SNMP processing
Junaid Shahid (1):
kvm: mmu: Fix race in emulated page table writes
Kai-Heng Feng (2):
USB: usb-storage: Add new IDs to ums-realtek
ALSA: hda: Add support for AMD Stoney Ridge
Kees Cook (1):
scsi: csiostor: Avoid content leaks and casts
Kevin Hilman (1):
ARC: change defconfig defaults to ARCv2
Laura Abbott (2):
kgdboc: Fix restrict error
kgdboc: Fix warning with module build
Linus Torvalds (1):
unifdef: use memcpy instead of strncpy
Lu Baolu (1):
iommu/vt-d: Fix NULL pointer dereference in prq_event_thread()
Macpaul Lin (1):
kgdboc: fix KASAN global-out-of-bounds bug in param_set_kgdboc_var()
Markus Hofstaetter (1):
leds: call led_pwm_set() in leds-pwm to enforce default LED_OFF
Martin Wilck (1):
scsi: scsi_devinfo: cleanly zero-pad devinfo strings
Mathias Kresin (1):
MIPS: ralink: Fix mt7620 nd_sd pinmux
Mathias Nyman (1):
xhci: Prevent U1/U2 link pm states if exit latency is too long
Mathias Payer (1):
USB: check usb_get_extra_descriptor for proper size
Matthias Schwarzott (1):
media: em28xx: Fix use-after-free when disconnecting
Max Filippov (2):
xtensa: enable coprocessors that are being flushed
xtensa: fix coprocessor context offset definitions
Michael Niewöhner (1):
usb: core: quirks: add RESET_RESUME quirk for Cherry G230 Stream series
Milo Kim (1):
leds: turn off the LED and wait for completion on unregistering LED class device
Nikolay Borisov (1):
btrfs: Always try all copies when reading extent buffers
Noah Westervelt (1):
Input: elan_i2c - add ACPI ID for Lenovo IdeaPad 330-15ARR
Pan Bian (3):
rapidio/rionet: do not free skb before reading its length
ext2: fix potential use after free
iommu/vt-d: Use memunmap to free memremap
Patrick Gaskin (1):
Input: elan_i2c - add ELAN0620 to the ACPI table
Paulo Alcantara (1):
cifs: Fix separator when building path from dentry
Pavel Tikhomirov (1):
mm: cleancache: fix corruption on missed inode invalidation
Peter Shih (1):
tty: serial: 8250_mtk: always resume the device in probe.
Richard Genoud (2):
dmaengine: at_hdmac: fix memory leak in at_dma_xlate()
dmaengine: at_hdmac: fix module unloading
Sagi Grimberg (1):
iser: set sector for ambiguous mr status errors
Sam Bobroff (1):
drm/ast: Fix incorrect free on ioregs
Sasha Levin (1):
Revert "wlcore: Add missing PM call for wlcore_cmd_wait_for_event_or_timeout()"
Simon Guo (1):
mm: mlock: avoid increase mm->locked_vm on mlock() when already mlock2(,MLOCK_ONFAULT)
Stephen Rothwell (1):
disable stringop truncation warnings for now
Sudarsana Reddy Kalluru (1):
bnx2x: Assign unique DMAE channel number for FW DMAE transactions.
Sultan Alsawaf (1):
ip_tunnel: Fix name string concatenate in __ip_tunnel_create()
Sven Eckelmann (1):
batman-adv: Expand merged fragment buffer for full packet
Takashi Iwai (7):
ALSA: wss: Fix invalid snd_free_pages() at error path
ALSA: ac97: Fix incorrect bit shift at AC97-SPSA control write
ALSA: control: Fix race between adding and removing a user element
ALSA: sparc: Fix invalid snd_free_pages() at error path
ALSA: trident: Suppress gcc string warning
ALSA: pcm: Call snd_pcm_unlink() conditionally at closing
ALSA: pcm: Fix interval evaluation with openmin/max
Tariq Toukan (1):
net/mlx4_core: Fix uninitialized variable compilation warning
Vasyl Vavrychuk (1):
mac80211_hwsim: Timer should be initialized before device registered
Vincent Chen (1):
net: faraday: ftmac100: remove netif_running(netdev) check before disabling interrupts
Wei Yongjun (1):
leds: leds-gpio: Fix return value check in create_gpio_led()
Xiongfeng Wang (1):
Kbuild: suppress packed-not-aligned warning for default setting only
Yangtao Li (1):
net: amd: add missing of_node_put()
YueHaibing (1):
misc: mic/scif: fix copy-paste error in scif_create_remote_lookup
Greg KH
maintainerMakefile +4 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 4 -SUBLEVEL = 166 +SUBLEVEL = 167 EXTRAVERSION = NAME = Blurry Fish Butt
@@ -793,6 +793,9 @@ KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) # disable pointer signed / unsigned warnings in gcc 4.0 KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign) +# disable stringop warnings in gcc 8+ +KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation) + # disable invalid "can't wrap" optimizations for signed / pointers KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
arch/arc/Kconfig +1 -1
@@ -96,7 +96,7 @@ endmenu choice prompt "ARC Instruction Set" - default ISA_ARCOMPACT + default ISA_ARCV2 config ISA_ARCOMPACT bool "ARCompact ISA"
arch/arc/Makefile +1 -1
@@ -12,7 +12,7 @@ ifeq ($(CROSS_COMPILE),) CROSS_COMPILE := arc-linux- endif -KBUILD_DEFCONFIG := nsim_700_defconfig +KBUILD_DEFCONFIG := nsim_hs_defconfig cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__ cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7
arch/arc/configs/axs101_defconfig +2 -0
@@ -17,6 +17,7 @@ CONFIG_PERF_EVENTS=y # CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_SLUB_DEBUG is not set # CONFIG_COMPAT_BRK is not set +CONFIG_ISA_ARCOMPACT=y CONFIG_MODULES=y CONFIG_PARTITION_ADVANCED=y CONFIG_ARC_PLAT_AXS10X=y
@@ -97,6 +98,7 @@ CONFIG_NTFS_FS=y CONFIG_TMPFS=y CONFIG_JFFS2_FS=y CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y # CONFIG_ENABLE_WARN_DEPRECATED is not set
arch/arc/configs/axs103_defconfig +1 -0
@@ -103,6 +103,7 @@ CONFIG_NTFS_FS=y CONFIG_TMPFS=y CONFIG_JFFS2_FS=y CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y # CONFIG_ENABLE_WARN_DEPRECATED is not set
arch/arc/configs/axs103_smp_defconfig +1 -0
@@ -104,6 +104,7 @@ CONFIG_NTFS_FS=y CONFIG_TMPFS=y CONFIG_JFFS2_FS=y CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y # CONFIG_ENABLE_WARN_DEPRECATED is not set
arch/arc/configs/nsim_700_defconfig +1 -0
@@ -16,6 +16,7 @@ CONFIG_KALLSYMS_ALL=y CONFIG_EMBEDDED=y # CONFIG_SLUB_DEBUG is not set # CONFIG_COMPAT_BRK is not set +CONFIG_ISA_ARCOMPACT=y CONFIG_KPROBES=y CONFIG_MODULES=y # CONFIG_LBDAF is not set
arch/arc/configs/nsimosci_defconfig +2 -0
@@ -17,6 +17,7 @@ CONFIG_KALLSYMS_ALL=y CONFIG_EMBEDDED=y # CONFIG_SLUB_DEBUG is not set # CONFIG_COMPAT_BRK is not set +CONFIG_ISA_ARCOMPACT=y CONFIG_KPROBES=y CONFIG_MODULES=y # CONFIG_LBDAF is not set
@@ -69,5 +70,6 @@ CONFIG_EXT2_FS_XATTR=y CONFIG_TMPFS=y # CONFIG_MISC_FILESYSTEMS is not set CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y # CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_MUST_CHECK is not set
arch/arc/configs/nsimosci_hs_defconfig +1 -0
@@ -69,5 +69,6 @@ CONFIG_EXT2_FS_XATTR=y CONFIG_TMPFS=y # CONFIG_MISC_FILESYSTEMS is not set CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y # CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_MUST_CHECK is not set
arch/arc/configs/nsimosci_hs_smp_defconfig +1 -0
@@ -88,6 +88,7 @@ CONFIG_EXT2_FS_XATTR=y CONFIG_TMPFS=y # CONFIG_MISC_FILESYSTEMS is not set CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y # CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_MUST_CHECK is not set CONFIG_FTRACE=y
arch/arc/configs/tb10x_defconfig +1 -0
@@ -19,6 +19,7 @@ CONFIG_KALLSYMS_ALL=y # CONFIG_AIO is not set CONFIG_EMBEDDED=y # CONFIG_COMPAT_BRK is not set +CONFIG_ISA_ARCOMPACT=y CONFIG_SLAB=y CONFIG_MODULES=y CONFIG_MODULE_FORCE_LOAD=y
arch/arc/configs/vdk_hs38_defconfig +1 -0
@@ -89,6 +89,7 @@ CONFIG_NTFS_FS=y CONFIG_TMPFS=y CONFIG_JFFS2_FS=y CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y # CONFIG_ENABLE_WARN_DEPRECATED is not set
arch/arc/configs/vdk_hs38_smp_defconfig +1 -0
@@ -91,6 +91,7 @@ CONFIG_NTFS_FS=y CONFIG_TMPFS=y CONFIG_JFFS2_FS=y CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y # CONFIG_ENABLE_WARN_DEPRECATED is not set
arch/mips/include/asm/syscall.h +1 -1
@@ -51,7 +51,7 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg,#ifdef CONFIG_64BIT case 4 :case 5 :case 6 :case 7 :#ifdef CONFIG_MIPS32_O32 -if (test_thread_flag (TIF_32BIT_REGS )) +if (test_tsk_thread_flag (task,TIF_32BIT_REGS ))return get_user (*arg, (int *)usp + n); else#endif
arch/mips/ralink/mt7620.c +1 -1
@@ -81,7 +81,7 @@ static struct rt2880_pmx_func pcie_rst_grp[] = { };static struct rt2880_pmx_func nd_sd_grp[] = {FUNC ("nand" ,MT7620_GPIO_MODE_NAND ,45 ,15 ), -FUNC ("sd" ,MT7620_GPIO_MODE_SD ,45 ,15 ) +FUNC ("sd" ,MT7620_GPIO_MODE_SD ,47 ,13 ) };static struct rt2880_pmx_group mt7620a_pinmux_data[] = {
arch/x86/kvm/mmu.c +9 -18
@@ -4174,9 +4174,9 @@ static void mmu_pte_write_flush_tlb(struct kvm_vcpu *vcpu, bool zap_page, }static u64 mmu_pte_write_fetch_gpte (struct kvm_vcpu *vcpu,gpa_t *gpa, -const u8 *new,int *bytes) +int *bytes) { -u64 gentry; +u64 gentry =0 ;int r;/*
@@ -4188,22 +4188,12 @@ static u64 mmu_pte_write_fetch_gpte(struct kvm_vcpu *vcpu, gpa_t *gpa,/* Handle a 32-bit guest writing two halves of a 64-bit gpte */ *gpa &= ~(gpa_t )7 ; *bytes =8 ; - r =kvm_vcpu_read_guest (vcpu, *gpa, &gentry,8 ); -if (r) - gentry =0 ; - new = (const u8 *)&gentry; } -switch (*bytes) { -case 4 : - gentry = *(const u32 *)new; -break ; -case 8 : - gentry = *(const u64 *)new; -break ; -default : - gentry =0 ; -break ; +if (*bytes ==4 || *bytes ==8 ) { + r =kvm_vcpu_read_guest_atomic (vcpu, *gpa, &gentry, *bytes); +if (r) + gentry =0 ; }return gentry;
@@ -4313,8 +4303,6 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,pgprintk ("%s: gpa %llx bytes %d\n" , __func__, gpa, bytes); - gentry =mmu_pte_write_fetch_gpte (vcpu, &gpa, new, &bytes); -/* * No need to care whether allocation memory is successful * or not since pte prefetch is skiped if it does not have
@@ -4323,6 +4311,9 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,mmu_topup_memory_caches (vcpu);spin_lock (&vcpu->kvm->mmu_lock); + + gentry =mmu_pte_write_fetch_gpte (vcpu, &gpa, &bytes); + ++vcpu->kvm->stat.mmu_pte_write;kvm_mmu_audit (vcpu,AUDIT_PRE_PTE_WRITE );
arch/xtensa/kernel/asm-offsets.c +8 -8
@@ -90,14 +90,14 @@ int main(void) DEFINE(THREAD_SP, offsetof (struct task_struct, thread.sp));DEFINE (THREAD_CPENABLE , offsetof (struct thread_info , cpenable));#if XTENSA_HAVE_COPROCESSORS -DEFINE (THREAD_XTREGS_CP0 , offsetof (struct thread_info , xtregs_cp)); -DEFINE (THREAD_XTREGS_CP1 , offsetof (struct thread_info , xtregs_cp)); -DEFINE (THREAD_XTREGS_CP2 , offsetof (struct thread_info , xtregs_cp)); -DEFINE (THREAD_XTREGS_CP3 , offsetof (struct thread_info , xtregs_cp)); -DEFINE (THREAD_XTREGS_CP4 , offsetof (struct thread_info , xtregs_cp)); -DEFINE (THREAD_XTREGS_CP5 , offsetof (struct thread_info , xtregs_cp)); -DEFINE (THREAD_XTREGS_CP6 , offsetof (struct thread_info , xtregs_cp)); -DEFINE (THREAD_XTREGS_CP7 , offsetof (struct thread_info , xtregs_cp)); + DEFINE(THREAD_XTREGS_CP0, offsetof(struct thread_info, xtregs_cp.cp0)); + DEFINE(THREAD_XTREGS_CP1, offsetof(struct thread_info, xtregs_cp.cp1)); + DEFINE(THREAD_XTREGS_CP2, offsetof(struct thread_info, xtregs_cp.cp2)); + DEFINE(THREAD_XTREGS_CP3, offsetof(struct thread_info, xtregs_cp.cp3)); + DEFINE(THREAD_XTREGS_CP4, offsetof(struct thread_info, xtregs_cp.cp4)); + DEFINE(THREAD_XTREGS_CP5, offsetof(struct thread_info, xtregs_cp.cp5)); + DEFINE(THREAD_XTREGS_CP6, offsetof(struct thread_info, xtregs_cp.cp6)); + DEFINE(THREAD_XTREGS_CP7, offsetof(struct thread_info, xtregs_cp.cp7));#endif DEFINE (THREAD_XTREGS_USER , offsetof (struct thread_info , xtregs_user));DEFINE (XTREGS_USER_SIZE ,sizeof (xtregs_user_t));
arch/xtensa/kernel/process.c +4 -1
@@ -83,18 +83,21 @@ void coprocessor_release_all(struct thread_info *ti)void coprocessor_flush_all (struct thread_info *ti) { -unsigned long cpenable; +unsigned long cpenable, old_cpenable;int i;preempt_disable (); +RSR_CPENABLE (old_cpenable); cpenable = ti->cpenable; +WSR_CPENABLE (cpenable);for (i =0 ; i <XCHAL_CP_MAX ; i++) {if ((cpenable &1 ) !=0 && coprocessor_owner[i] == ti)coprocessor_flush (ti, i); cpenable >>=1 ; } +WSR_CPENABLE (old_cpenable);preempt_enable (); }
drivers/dma/at_hdmac.c +9 -1
@@ -1781,6 +1781,12 @@ static void atc_free_chan_resources(struct dma_chan *chan) atchan->descs_allocated =0 ; atchan->status =0 ; +/* +* Free atslave allocated in at_dma_xlate() +*/ +kfree (chan->private); + chan->private =NULL ; +dev_vdbg (chan2dev (chan),"free_chan_resources: done\n" ); }
@@ -1815,7 +1821,7 @@ static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec,dma_cap_zero (mask);dma_cap_set (DMA_SLAVE , mask); - atslave =devm_kzalloc (&dmac_pdev->dev,sizeof (*atslave),GFP_KERNEL ); + atslave =kzalloc (sizeof (*atslave),GFP_KERNEL );if (!atslave)return NULL ;
@@ -2146,6 +2152,8 @@ static int at_dma_remove(struct platform_device *pdev)struct resource *io;at_dma_off (atdma); +if (pdev->dev.of_node) +of_dma_controller_free (pdev->dev.of_node);dma_async_device_unregister (&atdma->dma_common);dma_pool_destroy (atdma->memset_pool);
drivers/gpu/drm/ast/ast_main.c +2 -1
@@ -557,7 +557,8 @@ int ast_driver_unload(struct drm_device *dev)drm_mode_config_cleanup (dev);ast_mm_fini (ast); -pci_iounmap (dev->pdev, ast->ioregs); +if (ast->ioregs != ast->regs +AST_IO_MM_OFFSET ) +pci_iounmap (dev->pdev, ast->ioregs);pci_iounmap (dev->pdev, ast->regs);kfree (ast);return 0 ;
drivers/gpu/drm/gma500/mdfld_intel_display.c +1 -1
@@ -99,7 +99,7 @@ void mdfldWaitForPipeEnable(struct drm_device *dev, int pipe)/* Wait for for the pipe enable to take effect. */ for (count =0 ; count <COUNT_MAX ; count++) { temp =REG_READ (map->conf); -if ((temp &PIPEACONF_PIPE_STATE ) ==1 ) +if (temp &PIPEACONF_PIPE_STATE )break ; } }
drivers/infiniband/ulp/iser/iser_verbs.c +3 -4
@@ -1289,7 +1289,9 @@ u8 iser_check_task_pi_status(struct iscsi_iser_task *iser_task, IB_MR_CHECK_SIG_STATUS, &mr_status);if (ret) {pr_err ("ib_check_mr_status failed, ret %d\n" , ret); - goto err; +/* Not a lot we can do, return ambiguous guard error */ + *sector =0 ; +return 0x1 ; }if (mr_status.fail_status &IB_MR_CHECK_SIG_STATUS ) {
@@ -1317,7 +1319,4 @@ u8 iser_check_task_pi_status(struct iscsi_iser_task *iser_task, }return 0 ; -err: -/* Not alot we can do here, return ambiguous guard error */ -return 0x1 ; }
drivers/input/joystick/xpad.c +6 -10
@@ -483,18 +483,18 @@ static const u8 xboxone_hori_init[] = { };/* -* This packet is required for some of the PDP pads to start +* This packet is required for most (all?) of the PDP pads to start * sending input reports. These pads include: (0x0e6f:0x02ab), -* (0x0e6f:0x02a4). +* (0x0e6f:0x02a4), (0x0e6f:0x02a6). */ static const u8 xboxone_pdp_init1[] = {0x0a ,0x20 ,0x00 ,0x03 ,0x00 ,0x01 ,0x14 };/* -* This packet is required for some of the PDP pads to start +* This packet is required for most (all?) of the PDP pads to start * sending input reports. These pads include: (0x0e6f:0x02ab), -* (0x0e6f:0x02a4). +* (0x0e6f:0x02a4), (0x0e6f:0x02a6). */ static const u8 xboxone_pdp_init2[] = {0x06 ,0x20 ,0x00 ,0x02 ,0x01 ,0x00
@@ -530,12 +530,8 @@ static const struct xboxone_init_packet xboxone_init_packets[] = {XBOXONE_INIT_PKT (0x0e6f ,0x0165 , xboxone_hori_init),XBOXONE_INIT_PKT (0x0f0d ,0x0067 , xboxone_hori_init),XBOXONE_INIT_PKT (0x0000 ,0x0000 , xboxone_fw2015_init), -XBOXONE_INIT_PKT (0x0e6f ,0x02ab , xboxone_pdp_init1), -XBOXONE_INIT_PKT (0x0e6f ,0x02ab , xboxone_pdp_init2), -XBOXONE_INIT_PKT (0x0e6f ,0x02a4 , xboxone_pdp_init1), -XBOXONE_INIT_PKT (0x0e6f ,0x02a4 , xboxone_pdp_init2), -XBOXONE_INIT_PKT (0x0e6f ,0x02a6 , xboxone_pdp_init1), -XBOXONE_INIT_PKT (0x0e6f ,0x02a6 , xboxone_pdp_init2), +XBOXONE_INIT_PKT (0x0e6f ,0x0000 , xboxone_pdp_init1), +XBOXONE_INIT_PKT (0x0e6f ,0x0000 , xboxone_pdp_init2),XBOXONE_INIT_PKT (0x24c6 ,0x541a , xboxone_rumblebegin_init),XBOXONE_INIT_PKT (0x24c6 ,0x542a , xboxone_rumblebegin_init), XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumblebegin_init),
drivers/input/keyboard/matrix_keypad.c +14 -9
@@ -405,7 +405,7 @@ matrix_keypad_parse_dt(struct device *dev)struct matrix_keypad_platform_data *pdata;struct device_node *np = dev->of_node;unsigned int *gpios; -int i, nrow, ncol; +int ret, i, nrow, ncol;if (!np) {dev_err (dev,"device lacks DT data\n" );
@@ -447,12 +447,19 @@ matrix_keypad_parse_dt(struct device *dev)return ERR_PTR (-ENOMEM ); } -for (i =0 ; i < pdata->num_row_gpios; i++) - gpios[i] =of_get_named_gpio (np,"row-gpios" , i); +for (i =0 ; i < nrow; i++) { + ret =of_get_named_gpio (np,"row-gpios" , i); +if (ret <0 ) +return ERR_PTR (ret); + gpios[i] = ret; + } -for (i =0 ; i < pdata->num_col_gpios; i++) - gpios[pdata->num_row_gpios + i] = -of_get_named_gpio (np,"col-gpios" , i); +for (i =0 ; i < ncol; i++) { + ret =of_get_named_gpio (np,"col-gpios" , i); +if (ret <0 ) +return ERR_PTR (ret); + gpios[nrow + i] = ret; + } pdata->row_gpios = gpios; pdata->col_gpios = &gpios[pdata->num_row_gpios];
@@ -479,10 +486,8 @@ static int matrix_keypad_probe(struct platform_device *pdev) pdata =dev_get_platdata (&pdev->dev);if (!pdata) { pdata =matrix_keypad_parse_dt (&pdev->dev); -if (IS_ERR (pdata)) { -dev_err (&pdev->dev,"no platform data defined\n" ); +if (IS_ERR (pdata))return PTR_ERR (pdata); - } }else if (!pdata->keymap_data) {dev_err (&pdev->dev,"no keymap data defined\n" );return -EINVAL ;
drivers/input/mouse/elan_i2c_core.c +3 -0
@@ -1253,6 +1253,9 @@ static const struct acpi_device_id elan_acpi_id[] = { { "ELAN0618", 0 }, { "ELAN061C", 0 }, { "ELAN061D", 0 }, + { "ELAN061E", 0 }, + { "ELAN0620", 0 }, + { "ELAN0621", 0 }, { "ELAN0622", 0 }, { "ELAN1000", 0 }, { }
drivers/iommu/intel-iommu.c +1 -1
@@ -2977,7 +2977,7 @@ static int copy_context_table(struct intel_iommu *iommu, }if (old_ce) -iounmap (old_ce); +memunmap (old_ce); ret =0 ;if (devfn <0x80 )
drivers/iommu/intel-svm.c +1 -1
@@ -558,7 +558,7 @@ static irqreturn_t prq_event_thread(int irq, void *d)pr_err ("%s: Page request without PASID: %08llx %08llx\n" , iommu->name, ((unsigned long long *)req)[0 ], ((unsigned long long *)req)[1 ]); - goto bad_req; + goto no_pasid; }if (!svm || svm->pasid != req->pasid) {
drivers/iommu/ipmmu-vmsa.c +3 -0
@@ -372,6 +372,9 @@ static int ipmmu_domain_init_context(struct ipmmu_vmsa_domain *domain)static void ipmmu_domain_destroy_context (struct ipmmu_vmsa_domain *domain) { +if (!domain->mmu) +return ; +/* * Disable the context. Flush the TLB as required when modifying the * context registers.
drivers/leds/led-class.c +3 -2
@@ -247,12 +247,13 @@ void led_classdev_unregister(struct led_classdev *led_cdev)up_write (&led_cdev->trigger_lock);#endif -cancel_work_sync (&led_cdev->set_brightness_work); -/* Stop blinking */ led_stop_software_blink (led_cdev); +led_set_brightness (led_cdev,LED_OFF ); +flush_work (&led_cdev->set_brightness_work); +device_unregister (led_cdev->dev);down_write (&leds_list_lock);
drivers/leds/leds-gpio.c +2 -2
@@ -118,8 +118,8 @@ static int create_gpio_led(const struct gpio_led *template,return ret; led_dat->gpiod =gpio_to_desc (template->gpio); -if (IS_ERR (led_dat->gpiod)) -return PTR_ERR (led_dat->gpiod); +if (!led_dat->gpiod) +return -EINVAL ; } led_dat->cdev.name = template->name;
drivers/leds/leds-pwm.c +1 -0
@@ -132,6 +132,7 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv, ret =led_classdev_register (dev, &led_data->cdev);if (ret ==0 ) { priv->num_leds++; +led_pwm_set (&led_data->cdev, led_data->cdev.brightness); }else {dev_err (dev,"failed to register PWM led for %s: %d\n" , led->name, ret);
drivers/media/usb/em28xx/em28xx-dvb.c +2 -1
@@ -1806,6 +1806,8 @@ static int em28xx_dvb_fini(struct em28xx *dev) } } +em28xx_unregister_dvb (dvb); +/* remove I2C SEC */ client = dvb->i2c_client_sec;if (client) {
@@ -1827,7 +1829,6 @@ static int em28xx_dvb_fini(struct em28xx *dev)i2c_unregister_device (client); } -em28xx_unregister_dvb (dvb);kfree (dvb); dev->dvb =NULL ;kref_put (&dev->ref, em28xx_free_device);
drivers/misc/mic/scif/scif_rma.c +1 -1
@@ -414,7 +414,7 @@ static int scif_create_remote_lookup(struct scif_dev *remote_dev,if (err) goto error_window; err =scif_map_page (&window->num_pages_lookup.lookup[j], - vmalloc_dma_phys ? + vmalloc_num_pages ?vmalloc_to_page (&window->num_pages[i]) :virt_to_page (&window->num_pages[i]), remote_dev);
drivers/net/can/rcar_can.c +4 -1
@@ -24,6 +24,9 @@#define RCAR_CAN_DRV_NAME "rcar_can" +#define RCAR_SUPPORTED_CLOCKS (BIT(CLKR_CLKP1) | BIT(CLKR_CLKP2) | \ + BIT(CLKR_CLKEXT)) +/* Mailbox configuration: * mailbox 60 - 63 - Rx FIFO mailboxes * mailbox 56 - 59 - Tx FIFO mailboxes
@@ -789,7 +792,7 @@ static int rcar_can_probe(struct platform_device *pdev) goto fail_clk; } -if (clock_select >=ARRAY_SIZE (clock_names)) { +if (!(BIT (clock_select) &RCAR_SUPPORTED_CLOCKS )) { err = -EINVAL ;dev_err (&pdev->dev,"invalid CAN clock selected\n" ); goto fail_clk;
drivers/net/ethernet/amd/sunlance.c +3 -1
@@ -1419,7 +1419,7 @@ static int sparc_lance_probe_one(struct platform_device *op, prop =of_get_property (nd,"tpe-link-test?" ,NULL );if (!prop) - goto no_link_test; + goto node_put;if (strcmp (prop,"true" )) { printk(KERN_NOTICE "SunLance: warning: overriding option "
@@ -1428,6 +1428,8 @@ static int sparc_lance_probe_one(struct platform_device *op, "to [email protected]\n");auxio_set_lte (AUXIO_LTE_ON ); } +node_put: +of_node_put (nd); no_link_test: lp->auto_select =1 ; lp->tpe =0 ;
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +7 -0
@@ -2291,6 +2291,13 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,#define PMF_DMAE_C (bp) (BP_PORT(bp) * MAX_DMAE_C_PER_PORT + \ E1HVN_MAX) +/* Following is the DMAE channel number allocation for the clients. +* MFW: OCBB/OCSD implementations use DMAE channels 14/15 respectively. +* Driver: 0-3 and 8-11 (for PF dmae operations) +* 4 and 12 (for stats requests) +*/ +#define BNX2X_FW_DMAE_C 13/* Channel for FW DMAE operations */ +/* PCIE link and speed */ #define PCICFG_LINK_WIDTH 0x1f00000#define PCICFG_LINK_WIDTH_SHIFT 20
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +1 -0
@@ -5931,6 +5931,7 @@ static inline int bnx2x_func_send_start(struct bnx2x *bp, rdata->sd_vlan_tag =cpu_to_le16 (start_params->sd_vlan_tag); rdata->path_id =BP_PATH (bp); rdata->network_cos_mode = start_params->network_cos_mode; + rdata->dmae_cmd_id =BNX2X_FW_DMAE_C ; rdata->vxlan_dst_port =cpu_to_le16 (start_params->vxlan_dst_port); rdata->geneve_dst_port =cpu_to_le16 (start_params->geneve_dst_port);
drivers/net/ethernet/faraday/ftmac100.c +3 -4
@@ -865,11 +865,10 @@ static irqreturn_t ftmac100_interrupt(int irq, void *dev_id)struct net_device *netdev = dev_id;struct ftmac100 *priv =netdev_priv (netdev); -if (likely (netif_running (netdev))) { -/* Disable interrupts for polling */ -ftmac100_disable_all_int (priv); +/* Disable interrupts for polling */ +ftmac100_disable_all_int (priv); +if (likely (netif_running (netdev)))napi_schedule (&priv->napi); - }return IRQ_HANDLED ; }
drivers/net/ethernet/mellanox/mlx4/alloc.c +1 -1
@@ -339,7 +339,7 @@ void mlx4_zone_allocator_destroy(struct mlx4_zone_allocator *zone_alloc)static u32 __mlx4_alloc_from_zone (struct mlx4_zone_entry *zone,int count,int align,u32 skip_mask,u32 *puid) { -u32 uid; +u32 uid =0 ;u32 res;struct mlx4_zone_allocator *zone_alloc = zone->allocator;struct mlx4_zone_entry *curr_node;
drivers/net/ethernet/mellanox/mlx4/mlx4.h +2 -2
@@ -537,8 +537,8 @@ struct slave_list {struct resource_allocator {spinlock_t alloc_lock;/* protect quotas */ union { -int res_reserved; -int res_port_rsvd[MLX4_MAX_PORTS ]; +unsigned int res_reserved; +unsigned int res_port_rsvd[MLX4_MAX_PORTS ]; };union {int res_free;
drivers/net/ethernet/mellanox/mlx4/mr.c +1 -0
@@ -366,6 +366,7 @@ int mlx4_mr_hw_write_mpt(struct mlx4_dev *dev, struct mlx4_mr *mmr, container_of((void *)mpt_entry, struct mlx4_cmd_mailbox, buf); + (*mpt_entry)->lkey =0 ; err =mlx4_SW2HW_MPT (dev, mailbox, key); }
drivers/net/ethernet/qlogic/qed/qed_int.c +2 -0
@@ -177,6 +177,8 @@ static int qed_int_attentions(struct qed_hwfn *p_hwfn)*/ do { index = p_sb_attn->sb_index; +/* finish reading index before the loop condition */ +dma_rmb (); attn_bits =le32_to_cpu (p_sb_attn->atten_bits); attn_acks =le32_to_cpu (p_sb_attn->atten_ack); }while (index != p_sb_attn->sb_index);
drivers/net/ethernet/qlogic/qed/qed_main.c +1 -1
@@ -1124,9 +1124,9 @@ static int qed_drain(struct qed_dev *cdev)return -EBUSY ; } rc =qed_mcp_drain (hwfn, ptt); +qed_ptt_release (hwfn, ptt);if (rc)return rc; -qed_ptt_release (hwfn, ptt); }return 0 ;
drivers/net/rionet.c +1 -1
@@ -215,9 +215,9 @@ static int rionet_start_xmit(struct sk_buff *skb, struct net_device *ndev)* it just report sending a packet to the target * (without actual packet transfer). */ -dev_kfree_skb_any (skb); ndev->stats.tx_packets++; ndev->stats.tx_bytes += skb->len; +dev_kfree_skb_any (skb); } }
drivers/net/usb/ipheth.c +4 -6
@@ -140,7 +140,6 @@ struct ipheth_device {struct usb_device *udev;struct usb_interface *intf;struct net_device *net; -struct sk_buff *tx_skb;struct urb *tx_urb;struct urb *rx_urb;unsigned char *tx_buf;
@@ -229,6 +228,7 @@ static void ipheth_rcvbulk_callback(struct urb *urb)case -ENOENT :case -ECONNRESET :case -ESHUTDOWN : +case -EPROTO :return ;case 0 :break ;
@@ -280,7 +280,6 @@ static void ipheth_sndbulk_callback(struct urb *urb)dev_err (&dev->intf->dev,"%s: urb status: %d\n" , __func__, status); -dev_kfree_skb_irq (dev->tx_skb);netif_wake_queue (dev->net); }
@@ -410,7 +409,7 @@ static int ipheth_tx(struct sk_buff *skb, struct net_device *net)if (skb->len >IPHETH_BUF_SIZE ) {WARN (1 ,"%s: skb too large: %d bytes\n" , __func__, skb->len); dev->net->stats.tx_dropped++; -dev_kfree_skb_irq (skb); +dev_kfree_skb_any (skb);return NETDEV_TX_OK ; }
@@ -430,12 +429,11 @@ static int ipheth_tx(struct sk_buff *skb, struct net_device *net)dev_err (&dev->intf->dev,"%s: usb_submit_urb: %d\n" , __func__, retval); dev->net->stats.tx_errors++; -dev_kfree_skb_irq (skb); +dev_kfree_skb_any (skb); }else { - dev->tx_skb = skb; - dev->net->stats.tx_packets++; dev->net->stats.tx_bytes += skb->len; +dev_consume_skb_any (skb);netif_stop_queue (net); }
drivers/net/wireless/mac80211_hwsim.c +4 -4
@@ -2515,6 +2515,10 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,if (param->no_vif)ieee80211_hw_set (hw,NO_AUTO_VIF ); +tasklet_hrtimer_init (&data->beacon_timer, + mac80211_hwsim_beacon, +CLOCK_MONOTONIC ,HRTIMER_MODE_ABS ); + err =ieee80211_register_hw (hw);if (err <0 ) { printk(KERN_DEBUG "mac80211_hwsim: ieee80211_register_hw failed (%d)\n",
@@ -2539,10 +2543,6 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, data->debugfs, data, &hwsim_simulate_radar); -tasklet_hrtimer_init (&data->beacon_timer, - mac80211_hwsim_beacon, -CLOCK_MONOTONIC ,HRTIMER_MODE_ABS ); -spin_lock_bh (&hwsim_radio_lock);list_add_tail (&data->list, &hwsim_radios);spin_unlock_bh (&hwsim_radio_lock);
drivers/net/wireless/ti/wlcore/cmd.c +0 -6
@@ -35,7 +35,6 @@#include "wl12xx_80211.h" #include "cmd.h" #include "event.h" -#include "ps.h" #include "tx.h" #include "hw_ops.h"
@@ -192,10 +191,6 @@ int wlcore_cmd_wait_for_event_or_timeout(struct wl1271 *wl, timeout_time = jiffies +msecs_to_jiffies (WL1271_EVENT_TIMEOUT ); - ret =wl1271_ps_elp_wakeup (wl); -if (ret <0 ) -return ret; - do { if (time_after(jiffies, timeout_time)) { wl1271_debug(DEBUG_CMD, "timeout waiting for event %d",
@@ -227,7 +222,6 @@ int wlcore_cmd_wait_for_event_or_timeout(struct wl1271 *wl, }while (!event); out: -wl1271_ps_elp_sleep (wl);kfree (events_vector);return ret; }
drivers/s390/net/qeth_core_main.c +12 -15
@@ -4519,8 +4519,8 @@ static int qeth_snmp_command_cb(struct qeth_card *card, {struct qeth_ipa_cmd *cmd;struct qeth_arp_query_info *qinfo; -struct qeth_snmp_cmd *snmp;unsigned char *data; +void *snmp_data;__u16 data_len;QETH_CARD_TEXT (card,3 ,"snpcmdcb" );
@@ -4528,7 +4528,6 @@ static int qeth_snmp_command_cb(struct qeth_card *card, cmd = (struct qeth_ipa_cmd *) sdata; data = (unsigned char *)((char *)cmd - reply->offset); qinfo = (struct qeth_arp_query_info *) reply->param; - snmp = &cmd->data.setadapterparms.data.snmp;if (cmd->hdr.return_code) {QETH_CARD_TEXT_ (card,4 ,"scer1%x" , cmd->hdr.return_code);
@@ -4541,10 +4540,15 @@ static int qeth_snmp_command_cb(struct qeth_card *card,return 0 ; } data_len = *((__u16 *)QETH_IPA_PDU_LEN_PDU1 (data)); -if (cmd->data.setadapterparms.hdr.seq_no ==1 ) - data_len -= (__u16)((char *)&snmp->data - (char *)cmd); -else - data_len -= (__u16)((char *)&snmp->request - (char *)cmd); +if (cmd->data.setadapterparms.hdr.seq_no ==1 ) { + snmp_data = &cmd->data.setadapterparms.data.snmp; + data_len -= offsetof(struct qeth_ipa_cmd , + data.setadapterparms.data.snmp); + }else { + snmp_data = &cmd->data.setadapterparms.data.snmp.request; + data_len -= offsetof(struct qeth_ipa_cmd , + data.setadapterparms.data.snmp.request); + }/* check if there is enough room in userspace */ if ((qinfo->udata_len - qinfo->udata_offset) < data_len) {
@@ -4557,16 +4561,9 @@ static int qeth_snmp_command_cb(struct qeth_card *card,QETH_CARD_TEXT_ (card,4 ,"sseqn%i" , cmd->data.setadapterparms.hdr.seq_no);/*copy entries to user buffer*/ -if (cmd->data.setadapterparms.hdr.seq_no ==1 ) { -memcpy (qinfo->udata + qinfo->udata_offset, - (char *)snmp, - data_len + offsetof(struct qeth_snmp_cmd , data)); - qinfo->udata_offset += offsetof(struct qeth_snmp_cmd , data); - }else { -memcpy (qinfo->udata + qinfo->udata_offset, - (char *)&snmp->request, data_len); - } +memcpy (qinfo->udata + qinfo->udata_offset, snmp_data, data_len); qinfo->udata_offset += data_len; +/* check if all replies received ... */ QETH_CARD_TEXT_ (card,4 ,"srtot%i" , cmd->data.setadapterparms.hdr.used_total);
drivers/s390/virtio/virtio_ccw.c +14 -3
@@ -59,6 +59,7 @@ struct virtio_ccw_device {unsigned int revision;/* Transport revision */ wait_queue_head_t wait_q;spinlock_t lock; +struct mutex io_lock;/* Serializes I/O requests */ struct list_head virtqueues;unsigned long indicators;unsigned long indicators2;
@@ -307,6 +308,7 @@ static int ccw_io_helper(struct virtio_ccw_device *vcdev,unsigned long flags;int flag = intparm &VIRTIO_CCW_INTPARM_MASK ; +mutex_lock (&vcdev->io_lock); do { spin_lock_irqsave(get_ccwdev_lock(vcdev->cdev), flags); ret = ccw_device_start(vcdev->cdev, ccw, intparm, 0, 0);
@@ -319,7 +321,9 @@ static int ccw_io_helper(struct virtio_ccw_device *vcdev,cpu_relax (); }while (ret == -EBUSY );wait_event (vcdev->wait_q,doing_io (vcdev, flag) ==0 ); -return ret ? ret : vcdev->err; + ret = ret ? ret : vcdev->err; +mutex_unlock (&vcdev->io_lock); +return ret; } static void virtio_ccw_drop_indicator(struct virtio_ccw_device *vcdev,
@@ -833,6 +837,7 @@ static void virtio_ccw_get_config(struct virtio_device *vdev,int ret;struct ccw1 *ccw;void *config_area; +unsigned long flags; ccw =kzalloc (sizeof (*ccw),GFP_DMA |GFP_KERNEL );if (!ccw)
@@ -851,11 +856,13 @@ static void virtio_ccw_get_config(struct virtio_device *vdev,if (ret) goto out_free; +spin_lock_irqsave (&vcdev->lock, flags);memcpy (vcdev->config, config_area, offset + len); -if (buf) -memcpy (buf, &vcdev->config[offset], len);if (vcdev->config_ready < offset + len) vcdev->config_ready = offset + len; +spin_unlock_irqrestore (&vcdev->lock, flags); +if (buf) +memcpy (buf, config_area + offset, len); out_free:kfree (config_area);
@@ -869,6 +876,7 @@ static void virtio_ccw_set_config(struct virtio_device *vdev,struct virtio_ccw_device *vcdev =to_vc_device (vdev);struct ccw1 *ccw;void *config_area; +unsigned long flags; ccw =kzalloc (sizeof (*ccw),GFP_DMA |GFP_KERNEL );if (!ccw)
@@ -881,9 +889,11 @@ static void virtio_ccw_set_config(struct virtio_device *vdev,/* Make sure we don't overwrite fields. */ if (vcdev->config_ready < offset)virtio_ccw_get_config (vdev,0 ,NULL , offset); +spin_lock_irqsave (&vcdev->lock, flags);memcpy (&vcdev->config[offset], buf, len);/* Write the config area to the host. */ memcpy (config_area, vcdev->config,sizeof (vcdev->config)); +spin_unlock_irqrestore (&vcdev->lock, flags); ccw->cmd_code =CCW_CMD_WRITE_CONF ; ccw->flags =0 ; ccw->count = offset + len;
@@ -1230,6 +1240,7 @@ static int virtio_ccw_online(struct ccw_device *cdev)init_waitqueue_head (&vcdev->wait_q);INIT_LIST_HEAD (&vcdev->virtqueues);spin_lock_init (&vcdev->lock); +mutex_init (&vcdev->io_lock);spin_lock_irqsave (get_ccwdev_lock (cdev), flags);dev_set_drvdata (&cdev->dev, vcdev);
drivers/scsi/bfa/bfa_fcbuild.c +4 -4
@@ -1249,8 +1249,8 @@ fc_rspnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,memset (rspnid,0 ,sizeof (struct fcgs_rspnid_req_s )); rspnid->dap = s_id; - rspnid->spn_len = (u8 )strlen ((char *)name); -strncpy ((char *)rspnid->spn, (char *)name, rspnid->spn_len); +strlcpy (rspnid->spn, name,sizeof (rspnid->spn)); + rspnid->spn_len = (u8 )strlen (rspnid->spn);return sizeof (struct fcgs_rspnid_req_s ) +sizeof (struct ct_hdr_s ); }
@@ -1270,8 +1270,8 @@ fc_rsnn_nn_build(struct fchs_s *fchs, void *pyld, u32 s_id,memset (rsnn_nn,0 ,sizeof (struct fcgs_rsnn_nn_req_s )); rsnn_nn->node_name = node_name; - rsnn_nn->snn_len = (u8 )strlen ((char *)name); -strncpy ((char *)rsnn_nn->snn, (char *)name, rsnn_nn->snn_len); +strlcpy (rsnn_nn->snn, name,sizeof (rsnn_nn->snn)); + rsnn_nn->snn_len = (u8 )strlen (rsnn_nn->snn);return sizeof (struct fcgs_rsnn_nn_req_s ) +sizeof (struct ct_hdr_s ); }
drivers/scsi/bfa/bfa_fcs.c +39 -39
112 lines not on this page · raw message
drivers/scsi/bfa/bfa_fcs_lport.c +24 -38
134 lines not on this page · raw message
drivers/scsi/bfa/bfa_ioc.c +1 -1
@@ -2802,7 +2802,7 @@ void bfa_ioc_get_adapter_manufacturer(struct bfa_ioc_s *ioc, char *manufacturer) { memset((void *)manufacturer, 0, BFA_ADAPTER_MFG_NAME_LEN); -memcpy (manufacturer,BFA_MFG_NAME ,BFA_ADAPTER_MFG_NAME_LEN ); +strlcpy (manufacturer,BFA_MFG_NAME ,BFA_ADAPTER_MFG_NAME_LEN ); }void
drivers/scsi/bfa/bfa_svc.c +2 -2
@@ -365,8 +365,8 @@ bfa_plog_str(struct bfa_plog_s *plog, enum bfa_plog_mid mid, lp.eid = event; lp.log_type =BFA_PL_LOG_TYPE_STRING ; lp.misc = misc; -strncpy (lp.log_entry.string_log, log_str, -BFA_PL_STRING_LOG_SZ -1 ); +strlcpy (lp.log_entry.string_log, log_str, +BFA_PL_STRING_LOG_SZ ); lp.log_entry.string_log[BFA_PL_STRING_LOG_SZ -1 ] ='\0' ;bfa_plog_add (plog, &lp); }
drivers/scsi/bfa/bfad.c +10 -10
@@ -987,20 +987,20 @@ bfad_start_ops(struct bfad_s *bfad) {/* Fill the driver_info info to fcs*/ memset (&driver_info,0 ,sizeof (driver_info)); -strncpy (driver_info.version,BFAD_DRIVER_VERSION , -sizeof (driver_info.version) -1 ); +strlcpy (driver_info.version,BFAD_DRIVER_VERSION , +sizeof (driver_info.version));if (host_name) -strncpy (driver_info.host_machine_name, host_name, -sizeof (driver_info.host_machine_name) -1 ); +strlcpy (driver_info.host_machine_name, host_name, +sizeof (driver_info.host_machine_name));if (os_name) -strncpy (driver_info.host_os_name, os_name, -sizeof (driver_info.host_os_name) -1 ); +strlcpy (driver_info.host_os_name, os_name, +sizeof (driver_info.host_os_name));if (os_patch) -strncpy (driver_info.host_os_patch, os_patch, -sizeof (driver_info.host_os_patch) -1 ); +strlcpy (driver_info.host_os_patch, os_patch, +sizeof (driver_info.host_os_patch)); -strncpy (driver_info.os_device_name, bfad->pci_name, -sizeof (driver_info.os_device_name) -1 ); +strlcpy (driver_info.os_device_name, bfad->pci_name, +sizeof (driver_info.os_device_name));/* FCS driver info init */ spin_lock_irqsave (&bfad->bfad_lock, flags);
drivers/scsi/bfa/bfad_attr.c +1 -1
@@ -842,7 +842,7 @@ bfad_im_symbolic_name_show(struct device *dev, struct device_attribute *attr,char symname[BFA_SYMNAME_MAXLEN ];bfa_fcs_lport_get_attr (&bfad->bfa_fcs.fabric.bport, &port_attr); -strncpy (symname, port_attr.port_cfg.sym_name.symname, +strlcpy (symname, port_attr.port_cfg.sym_name.symname,BFA_SYMNAME_MAXLEN );return snprintf (buf,PAGE_SIZE ,"%s\n" , symname); }
drivers/scsi/bfa/bfad_bsg.c +3 -3
@@ -126,7 +126,7 @@ bfad_iocmd_ioc_get_attr(struct bfad_s *bfad, void *cmd)/* fill in driver attr info */ strcpy (iocmd->ioc_attr.driver_attr.driver,BFAD_DRIVER_NAME ); -strncpy (iocmd->ioc_attr.driver_attr.driver_ver, +strlcpy (iocmd->ioc_attr.driver_attr.driver_ver,BFAD_DRIVER_VERSION ,BFA_VERSION_LEN );strcpy (iocmd->ioc_attr.driver_attr.fw_ver, iocmd->ioc_attr.adapter_attr.fw_ver);
@@ -314,9 +314,9 @@ bfad_iocmd_port_get_attr(struct bfad_s *bfad, void *cmd) iocmd->attr.port_type = port_attr.port_type; iocmd->attr.loopback = port_attr.loopback; iocmd->attr.authfail = port_attr.authfail; -strncpy (iocmd->attr.port_symname.symname, +strlcpy (iocmd->attr.port_symname.symname, port_attr.port_cfg.sym_name.symname, -sizeof (port_attr.port_cfg.sym_name.symname)); +sizeof (iocmd->attr.port_symname.symname)); iocmd->status =BFA_STATUS_OK ;return 0 ;
drivers/scsi/csiostor/csio_lnode.c +26 -17
109 lines not on this page · raw message
drivers/scsi/scsi_devinfo.c +7 -15
@@ -33,7 +33,6 @@ struct scsi_dev_info_list_table { }; -static const char spaces[] =" " ;/* 16 of them */ static unsigned scsi_default_dev_flags;static LIST_HEAD (scsi_dev_info_list);static char scsi_dev_flags[256 ];
@@ -291,20 +290,13 @@ static void scsi_strcpy_devinfo(char *name, char *to, size_t to_length,size_t from_length; from_length =strlen (from); -strncpy (to, from,min (to_length, from_length)); -if (from_length < to_length) { -if (compatible) { -/* -* NUL terminate the string if it is short. -*/ - to[from_length] ='\0' ; - }else { -/* -* space pad the string if it is short. -*/ -strncpy (&to[from_length], spaces, - to_length - from_length); - } +/* this zero-pads the destination */ +strncpy (to, from, to_length); +if (from_length < to_length && !compatible) { +/* +* space pad the string if it is short. +*/ +memset (&to[from_length],' ' , to_length - from_length); }if (from_length > to_length) printk(KERN_WARNING "%s: %s string '%s' is too long\n",
drivers/staging/lustre/lustre/lmv/lmv_obd.c +1 -1
@@ -700,7 +700,7 @@ repeat_fid2path:memmove (ptr +strlen (gf->gf_path) +1 , ptr,strlen (ori_gf->gf_path)); -strncpy (ptr, gf->gf_path,strlen (gf->gf_path)); +strcpy (ptr, gf->gf_path); ptr +=strlen (gf->gf_path); *ptr ='/' ; }
drivers/staging/rts5208/sd.c +0 -6
@@ -4165,12 +4165,6 @@ RTY_SEND_CMD:rtsx_trace (chip);return STATUS_FAIL ; } - - }else if (rsp_type ==SD_RSP_TYPE_R0 ) { -if ((ptr[3 ] &0x1E ) !=0x03 ) { -rtsx_trace (chip); -return STATUS_FAIL ; - } } } }
drivers/tty/serial/8250/8250_mtk.c +7 -9
@@ -231,17 +231,17 @@ static int mtk8250_probe(struct platform_device *pdev)platform_set_drvdata (pdev, data); -pm_runtime_enable (&pdev->dev); -if (!pm_runtime_enabled (&pdev->dev)) { - err =mtk8250_runtime_resume (&pdev->dev); -if (err) -return err; - } + err =mtk8250_runtime_resume (&pdev->dev); +if (err) +return err; data->line =serial8250_register_8250_port (&uart);if (data->line <0 )return data->line; +pm_runtime_set_active (&pdev->dev); +pm_runtime_enable (&pdev->dev); +return 0 ; }
@@ -252,13 +252,11 @@ static int mtk8250_remove(struct platform_device *pdev)pm_runtime_get_sync (&pdev->dev);serial8250_unregister_port (data->line); +mtk8250_runtime_suspend (&pdev->dev);pm_runtime_disable (&pdev->dev);pm_runtime_put_noidle (&pdev->dev); -if (!pm_runtime_status_suspended (&pdev->dev)) -mtk8250_runtime_suspend (&pdev->dev); -return 0 ; }
drivers/tty/serial/kgdboc.c +23 -24
82 lines not on this page · raw message
drivers/usb/core/hub.c +1 -1
@@ -2211,7 +2211,7 @@ static int usb_enumerate_device_otg(struct usb_device *udev)/* descriptor may appear anywhere in config */ err =__usb_get_extra_descriptor (udev->rawdescriptors[0 ],le16_to_cpu (udev->config[0 ].desc.wTotalLength), -USB_DT_OTG , (void **) &desc); +USB_DT_OTG , (void **) &desc,sizeof (*desc));if (err || !(desc->bmAttributes &USB_OTG_HNP ))return 0 ;
drivers/usb/core/quirks.c +7 -0
@@ -64,6 +64,9 @@ static const struct usb_device_id usb_quirk_list[] = {/* Microsoft LifeCam-VX700 v2.0 */ { USB_DEVICE(0x045e, 0x0770), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Cherry Stream G230 2.0 (G85-231) and 3.0 (G85-232) */ + { USB_DEVICE(0x046a, 0x0023), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Logitech HD Pro Webcams C920, C920-C, C925e and C930e */ { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT }, { USB_DEVICE(0x046d, 0x0841), .driver_info = USB_QUIRK_DELAY_INIT },
@@ -185,6 +188,10 @@ static const struct usb_device_id usb_quirk_list[] = {/* Midiman M-Audio Keystation 88es */ { USB_DEVICE(0x0763, 0x0192), .driver_info = USB_QUIRK_RESET_RESUME }, + /* SanDisk Ultra Fit and Ultra Flair */ + { USB_DEVICE(0x0781, 0x5583), .driver_info = USB_QUIRK_NO_LPM }, + { USB_DEVICE(0x0781, 0x5591), .driver_info = USB_QUIRK_NO_LPM }, + /* M-Systems Flash Disk Pioneers */ { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
drivers/usb/core/usb.c +3 -3
@@ -678,14 +678,14 @@ EXPORT_SYMBOL_GPL(usb_get_current_frame_number);*/ int __usb_get_extra_descriptor (char *buffer,unsigned size, -unsigned char type,void **ptr) +unsigned char type,void **ptr,size_t minsize) {struct usb_descriptor_header *header;while (size >=sizeof (struct usb_descriptor_header )) { header = (struct usb_descriptor_header *)buffer; -if (header->bLength <2 ) { +if (header->bLength <2 || header->bLength > size) { printk(KERN_ERR "%s: bogus descriptor, type %d length %d\n", usbcore_name,
@@ -694,7 +694,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size,return -1 ; } -if (header->bDescriptorType == type) { +if (header->bDescriptorType == type && header->bLength >= minsize) { *ptr = header;return 0 ; }
drivers/usb/gadget/udc/dummy_hcd.c +4 -5
@@ -379,11 +379,10 @@ static void set_link_state_by_speed(struct dummy_hcd *dum_hcd) USB_PORT_STAT_CONNECTION) == 0) dum_hcd->port_status |= (USB_PORT_STAT_C_CONNECTION <<16 ); -if ((dum_hcd->port_status & -USB_PORT_STAT_ENABLE ) ==1 && - (dum_hcd->port_status & -USB_SS_PORT_LS_U0 ) ==1 && - dum_hcd->rh_state !=DUMMY_RH_SUSPENDED ) +if ((dum_hcd->port_status &USB_PORT_STAT_ENABLE ) && + (dum_hcd->port_status & +USB_PORT_STAT_LINK_STATE ) ==USB_SS_PORT_LS_U0 && + dum_hcd->rh_state !=DUMMY_RH_SUSPENDED ) dum_hcd->active =1 ; } }else {
drivers/usb/host/hwa-hc.c +1 -1
@@ -654,7 +654,7 @@ static int hwahc_security_create(struct hwahc *hwahc) top = itr + itr_size; result =__usb_get_extra_descriptor (usb_dev->rawdescriptors[index],le16_to_cpu (usb_dev->actconfig->desc.wTotalLength), -USB_DT_SECURITY , (void **) &secd); +USB_DT_SECURITY , (void **) &secd,sizeof (*secd));if (result ==-1 ) {dev_warn (dev,"BUG? WUSB host has no security descriptors\n" );return 0 ;
drivers/usb/host/xhci.c +16 -0
@@ -4417,6 +4417,14 @@ static u16 xhci_calculate_u1_timeout(struct xhci_hcd *xhci, {unsigned long long timeout_ns; +/* Prevent U1 if service interval is shorter than U1 exit latency */ +if (usb_endpoint_xfer_int (desc) ||usb_endpoint_xfer_isoc (desc)) { +if (xhci_service_interval_to_ns (desc) <= udev->u1_params.mel) { +dev_dbg (&udev->dev,"Disable U1, ESIT shorter than exit latency\n" ); +return USB3_LPM_DISABLED ; + } + } +if (xhci->quirks &XHCI_INTEL_HOST ) timeout_ns =xhci_calculate_intel_u1_timeout (udev, desc);else
@@ -4473,6 +4481,14 @@ static u16 xhci_calculate_u2_timeout(struct xhci_hcd *xhci, {unsigned long long timeout_ns; +/* Prevent U2 if service interval is shorter than U2 exit latency */ +if (usb_endpoint_xfer_int (desc) ||usb_endpoint_xfer_isoc (desc)) { +if (xhci_service_interval_to_ns (desc) <= udev->u2_params.mel) { +dev_dbg (&udev->dev,"Disable U2, ESIT shorter than exit latency\n" ); +return USB3_LPM_DISABLED ; + } + } +if (xhci->quirks &XHCI_INTEL_HOST ) timeout_ns =xhci_calculate_intel_u2_timeout (udev, desc);else
drivers/usb/misc/appledisplay.c +1 -0
@@ -64,6 +64,7 @@ static const struct usb_device_id appledisplay_table[] = { { APPLEDISPLAY_DEVICE(0x921c) }, { APPLEDISPLAY_DEVICE(0x921d) }, { APPLEDISPLAY_DEVICE(0x9222) }, + { APPLEDISPLAY_DEVICE(0x9226) }, { APPLEDISPLAY_DEVICE(0x9236) },/* Terminating entry */
drivers/usb/storage/unusual_realtek.h +10 -0
@@ -38,4 +38,14 @@ UNUSUAL_DEV(0x0bda, 0x0159, 0x0000, 0x9999, "USB Card Reader", USB_SC_DEVICE, USB_PR_DEVICE, init_realtek_cr, 0), +UNUSUAL_DEV(0x0bda, 0x0177, 0x0000, 0x9999, + "Realtek", + "USB Card Reader", + USB_SC_DEVICE, USB_PR_DEVICE, init_realtek_cr, 0), + +UNUSUAL_DEV(0x0bda, 0x0184, 0x0000, 0x9999, + "Realtek", + "USB Card Reader", + USB_SC_DEVICE, USB_PR_DEVICE, init_realtek_cr, 0), +#endif /* defined(CONFIG_USB_STORAGE_REALTEK) || ... */
fs/btrfs/disk-io.c +1 -9
@@ -445,9 +445,9 @@ static int btree_read_extent_buffer_pages(struct btrfs_root *root,int mirror_num =0 ;int failed_mirror =0 ; -clear_bit (EXTENT_BUFFER_CORRUPT , &eb->bflags); io_tree = &BTRFS_I (root->fs_info->btree_inode)->io_tree;while (1 ) { +clear_bit (EXTENT_BUFFER_CORRUPT , &eb->bflags); ret =read_extent_buffer_pages (io_tree, eb, start,WAIT_COMPLETE , btree_get_extent, mirror_num);
@@ -459,14 +459,6 @@ static int btree_read_extent_buffer_pages(struct btrfs_root *root, ret = -EIO ; } -/* -* This buffer's crc is fine, but its contents are corrupted, so -* there is no reason to read the other copies, they won't be -* any less wrong. -*/ -if (test_bit (EXTENT_BUFFER_CORRUPT , &eb->bflags)) -break ; - num_copies =btrfs_num_copies (root->fs_info, eb->start, eb->len);if (num_copies ==1 )
fs/btrfs/free-space-cache.c +2 -0
@@ -2469,6 +2469,7 @@ void btrfs_dump_free_space(struct btrfs_block_group_cache *block_group,struct rb_node *n;int count =0 ; +spin_lock (&ctl->tree_lock);for (n =rb_first (&ctl->free_space_offset); n; n =rb_next (n)) { info = rb_entry(n, struct btrfs_free_space, offset_index);if (info->bytes >= bytes && !block_group->ro)
@@ -2478,6 +2479,7 @@ void btrfs_dump_free_space(struct btrfs_block_group_cache *block_group, info->offset, info->bytes, (info->bitmap) ? "yes" : "no"); } +spin_unlock (&ctl->tree_lock);btrfs_info (block_group->fs_info,"block group has cluster?: %s" ,list_empty (&block_group->cluster_list) ?"no" :"yes" ); btrfs_info(block_group->fs_info,
fs/btrfs/super.c +1 -0
@@ -2104,6 +2104,7 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd, vol =memdup_user ((void __user *)arg,sizeof (*vol));if (IS_ERR (vol))return PTR_ERR (vol); + vol->name[BTRFS_PATH_NAME_MAX ] ='\0' ;switch (cmd) {case BTRFS_IOC_SCAN_DEV :
fs/btrfs/transaction.c +3 -3
@@ -1821,6 +1821,9 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,return ret; } +btrfs_trans_release_metadata (trans, root); + trans->block_rsv =NULL ; +/* make a pass through all the delayed refs we have so far * any runnings procs may add more while we are here */
@@ -1830,9 +1833,6 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,return ret; } -btrfs_trans_release_metadata (trans, root); - trans->block_rsv =NULL ; - cur_trans = trans->transaction;/*
fs/cifs/dir.c +1 -1
@@ -163,7 +163,7 @@ cifs_bp_rename_retry:cifs_dbg (FYI ,"using cifs_sb prepath <%s>\n" , cifs_sb->prepath);memcpy (full_path+dfsplen+1 , cifs_sb->prepath, pplen-1 ); - full_path[dfsplen] ='\\' ; + full_path[dfsplen] = dirsep;for (i =0 ; i < pplen-1 ; i++)if (full_path[dfsplen+1 +i] =='/' ) full_path[dfsplen+1 +i] =CIFS_DIR_SEP (cifs_sb);
fs/exec.c +3 -4
@@ -1077,15 +1077,14 @@ killed:return -EAGAIN ; } -char *get_task_comm (char *buf,struct task_struct *tsk) +char *__get_task_comm (char *buf,size_t buf_size,struct task_struct *tsk) { -/* buf must be at least sizeof(tsk->comm) in size */ task_lock (tsk); -strncpy (buf, tsk->comm,sizeof (tsk->comm)); +strncpy (buf, tsk->comm, buf_size);task_unlock (tsk);return buf; } -EXPORT_SYMBOL_GPL (get_task_comm); +EXPORT_SYMBOL_GPL (__get_task_comm);/* * These functions flushes out all traces of the currently running executable
fs/ext2/xattr.c +1 -1
@@ -605,9 +605,9 @@ skip_replace: } cleanup: -brelse (bh);if (!(bh && header ==HDR (bh)))kfree (header); +brelse (bh);up_write (&EXT2_I (inode)->xattr_sem);return error;
fs/kernfs/symlink.c +1 -1
@@ -88,7 +88,7 @@ static int kernfs_get_target_path(struct kernfs_node *parent,int slen =strlen (kn->name); len -= slen; -strncpy (s + len, kn->name, slen); +memcpy (s + len, kn->name, slen);if (len) s[--len] ='/' ;
include/linux/sched.h +6 -1
@@ -2668,7 +2668,12 @@ static inline void set_task_comm(struct task_struct *tsk, const char *from) {__set_task_comm (tsk, from, false); } -extern char *get_task_comm (char *to,struct task_struct *tsk); + +extern char *__get_task_comm (char *to,size_t len,struct task_struct *tsk); +#define get_task_comm (buf, tsk) ({ \ + BUILD_BUG_ON(sizeof(buf) != TASK_COMM_LEN); \ + __get_task_comm(buf, sizeof(buf), tsk); \ +})#ifdef CONFIG_SMP void scheduler_ipi (void );
include/linux/usb.h +2 -2
@@ -334,11 +334,11 @@ struct usb_host_bos { };int __usb_get_extra_descriptor (char *buffer,unsigned size, -unsigned char type,void **ptr); +unsigned char type,void **ptr,size_t min);#define usb_get_extra_descriptor (ifpoint, type, ptr) \ __usb_get_extra_descriptor((ifpoint)->extra, \ (ifpoint)->extralen, \ - type, (void **)ptr) + type, (void **)ptr, sizeof(**(ptr)))/* ----------------------------------------------------------------------- */
include/sound/pcm_params.h +3 -1
@@ -247,11 +247,13 @@ static inline int snd_interval_empty(const struct snd_interval *i)static inline int snd_interval_single (const struct snd_interval *i) {return (i->min == i->max || - (i->min +1 == i->max && i->openmax)); + (i->min +1 == i->max && (i->openmin || i->openmax))); }static inline int snd_interval_value (const struct snd_interval *i) { +if (i->openmin && !i->openmax) +return i->max;return i->min; }
kernel/debug/kdb/kdb_support.c +2 -2
@@ -129,13 +129,13 @@ int kdbnearsym(unsigned long addr, kdb_symtab_t *symtab) }if (i >=ARRAY_SIZE (kdb_name_table)) {debug_kfree (kdb_name_table[0 ]); -memcpy (kdb_name_table, kdb_name_table+1 , +memmove (kdb_name_table, kdb_name_table+1 ,sizeof (kdb_name_table[0 ]) * (ARRAY_SIZE (kdb_name_table)-1 )); }else {debug_kfree (knt1); knt1 = kdb_name_table[i]; -memcpy (kdb_name_table+i, kdb_name_table+i+1 , +memmove (kdb_name_table+i, kdb_name_table+i+1 ,sizeof (kdb_name_table[0 ]) * (ARRAY_SIZE (kdb_name_table)-i-1 )); }
kernel/events/uprobes.c +10 -2
@@ -606,7 +606,7 @@ static int prepare_uprobe(struct uprobe *uprobe, struct file *file,BUG_ON ((uprobe->offset & ~PAGE_MASK ) +UPROBE_SWBP_INSN_SIZE >PAGE_SIZE ); -smp_wmb ();/* pairs with rmb() in find_active_uprobe() */ +smp_wmb ();/* pairs with the smp_rmb() in handle_swbp() */ set_bit (UPROBE_COPY_INSN , &uprobe->flags); out:
@@ -1892,10 +1892,18 @@ static void handle_swbp(struct pt_regs *regs)* After we hit the bp, _unregister + _register can install the * new and not-yet-analyzed uprobe at the same address, restart. */ -smp_rmb ();/* pairs with wmb() in install_breakpoint() */ if (unlikely (!test_bit (UPROBE_COPY_INSN , &uprobe->flags))) goto out; +/* +* Pairs with the smp_wmb() in prepare_uprobe(). +* +* Guarantees that if we see the UPROBE_COPY_INSN bit set, then +* we must also see the stores to &uprobe->arch performed by the +* prepare_uprobe() call. +*/ +smp_rmb (); +/* Tracing handlers use ->utask to communicate with fetch methods */ if (!get_utask ()) goto out;
lib/kobject.c +1 -1
@@ -127,7 +127,7 @@ static void fill_kobj_path(struct kobject *kobj, char *path, int length)int cur =strlen (kobject_name (parent));/* back up enough to print this name with '/' */ length -= cur; -strncpy (path + length,kobject_name (parent), cur); +memcpy (path + length,kobject_name (parent), cur); *(path + --length) ='/' ; }
mm/mlock.c +3 -0
@@ -504,6 +504,7 @@ static int mlock_fixup(struct vm_area_struct *vma, struct vm_area_struct **prev,int nr_pages;int ret =0 ;int lock = !!(newflags &VM_LOCKED ); +vm_flags_t old_flags = vma->vm_flags;if (newflags == vma->vm_flags || (vma->vm_flags &VM_SPECIAL ) ||is_vm_hugetlb_page (vma) || vma ==get_gate_vma (current->mm))
@@ -538,6 +539,8 @@ success: nr_pages = (end - start) >>PAGE_SHIFT ;if (!lock) nr_pages = -nr_pages; +else if (old_flags &VM_LOCKED ) + nr_pages =0 ; mm->locked_vm += nr_pages;/*
mm/truncate.c +6 -2
@@ -432,9 +432,13 @@ void truncate_inode_pages_final(struct address_space *mapping)*/ spin_lock_irq (&mapping->tree_lock);spin_unlock_irq (&mapping->tree_lock); - -truncate_inode_pages (mapping,0 ); } + +/* +* Cleancache needs notification even if there are no pages or shadow +* entries. +*/ +truncate_inode_pages (mapping,0 ); }EXPORT_SYMBOL (truncate_inode_pages_final);
net/batman-adv/fragmentation.c +1 -1
@@ -266,7 +266,7 @@ batadv_frag_merge_packets(struct hlist_head *chain)kfree (entry); packet = (struct batadv_frag_packet *)skb_out->data; - size =ntohs (packet->total_size); + size =ntohs (packet->total_size) + hdr_size;/* Make room for the rest of the fragments. */ if (pskb_expand_head (skb_out,0 , size - skb_out->len,GFP_ATOMIC ) <0 ) {
net/ipv4/ip_tunnel.c +2 -2
@@ -261,8 +261,8 @@ static struct net_device *__ip_tunnel_create(struct net *net, }else {if (strlen (ops->kind) > (IFNAMSIZ -3 )) goto failed; -strlcpy (name, ops->kind,IFNAMSIZ ); -strncat (name,"%d" ,2 ); +strcpy (name, ops->kind); +strcat (name,"%d" ); }ASSERT_RTNL ();
net/mac80211/iface.c +2 -0
@@ -987,6 +987,8 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,if (local->open_count ==0 )ieee80211_clear_tx_pending (local); + sdata->vif.bss_conf.beacon_int =0 ; +/* * If the interface goes down while suspended, presumably because * the device was unplugged and that happens before our resume,
net/mac80211/rx.c +1 -0
@@ -1109,6 +1109,7 @@ ieee80211_rx_h_check_dup(struct ieee80211_rx_data *rx)return RX_CONTINUE ;if (ieee80211_is_ctl (hdr->frame_control) || +ieee80211_is_nullfunc (hdr->frame_control) ||ieee80211_is_qos_nullfunc (hdr->frame_control) ||is_multicast_ether_addr (hdr->addr1))return RX_CONTINUE ;
net/mac80211/status.c +2 -0
@@ -648,6 +648,8 @@ void ieee80211_tx_status_noskb(struct ieee80211_hw *hw,/* Track when last TDLS packet was ACKed */ if (test_sta_flag (sta,WLAN_STA_TDLS_PEER_AUTH )) sta->status_stats.last_tdls_pkt_time = jiffies; + }else if (test_sta_flag (sta,WLAN_STA_PS_STA )) { +return ; }else {ieee80211_lost_packet (sta, info); }
net/mac80211/tx.c +2 -2
@@ -431,8 +431,8 @@ ieee80211_tx_h_multicast_ps_buf(struct ieee80211_tx_data *tx)if (ieee80211_hw_check (&tx->local->hw,QUEUE_CONTROL )) info->hw_queue = tx->sdata->vif.cab_queue; -/* no stations in PS mode */ -if (!atomic_read (&ps->num_sta_ps)) +/* no stations in PS mode and no buffered packets */ +if (!atomic_read (&ps->num_sta_ps) &&skb_queue_empty (&ps->bc_buf))return TX_CONTINUE ; info->flags |=IEEE80211_TX_CTL_SEND_AFTER_DTIM ;
net/sunrpc/auth_gss/auth_gss.c +4 -0
@@ -1722,6 +1722,7 @@ priv_release_snd_buf(struct rpc_rqst *rqstp)for (i=0 ; i < rqstp->rq_enc_pages_num; i++)__free_page (rqstp->rq_enc_pages[i]);kfree (rqstp->rq_enc_pages); + rqstp->rq_release_snd_buf =NULL ; } static int
@@ -1730,6 +1731,9 @@ alloc_enc_pages(struct rpc_rqst *rqstp)struct xdr_buf *snd_buf = &rqstp->rq_snd_buf;int first, last, i; +if (rqstp->rq_release_snd_buf) + rqstp->rq_release_snd_buf (rqstp); +if (snd_buf->page_len ==0 ) { rqstp->rq_enc_pages_num =0 ;return 0 ;
scripts/Makefile.extrawarn +3 -0
@@ -10,6 +10,8 @@ # are not supported by all versions of the compiler # ========================================================================== +KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned) + ifeq ("$(origin W)", "command line") export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W) endif
@@ -25,6 +27,7 @@ warning-1 += -Wold-style-definition warning-1 += $(call cc-option, -Wmissing-include-dirs) warning-1 += $(call cc-option, -Wunused-but-set-variable) warning-1 += $(call cc-option, -Wunused-const-variable) +warning-1 += $(call cc-option, -Wpacked-not-aligned) warning-1 += $(call cc-disable-warning, missing-field-initializers) warning-2 := -Waggregate-return
scripts/unifdef.c +2 -2
@@ -395,7 +395,7 @@ usage(void)* When we have processed a group that starts off with a known-false * #if/#elif sequence (which has therefore been deleted) followed by a * #elif that we don't understand and therefore must keep, we edit the -* latter into a #if to keep the nesting correct. We use strncpy() to +* latter into a #if to keep the nesting correct. We use memcpy() to * overwrite the 4 byte token "elif" with "if " without a '\0' byte. * * When we find a true #elif in a group, the following block will
@@ -450,7 +450,7 @@ static void Idrop (void) { Fdrop(); ignoreon(); }static void Itrue (void ) {Ftrue ();ignoreon (); }static void Ifalse (void ) {Ffalse ();ignoreon (); }/* modify this line */ -static void Mpass (void ) {strncpy (keyword,"if " ,4 );Pelif (); } +static void Mpass (void ) {memcpy (keyword,"if " ,4 );Pelif (); }static void Mtrue (void ) {keywordedit ("else" );state (IS_TRUE_MIDDLE ); }static void Melif (void ) {keywordedit ("endif" );state (IS_FALSE_TRAILER ); }static void Melse (void ) {keywordedit ("endif" );state (IS_FALSE_ELSE ); }
sound/core/control.c +45 -35
115 lines not on this page · raw message
sound/core/pcm_native.c +8 -6
@@ -35,6 +35,7 @@#include <sound/timer.h> #include <sound/minors.h> #include <linux/uio.h> +#include <linux/delay.h> /* * Compatibility
@@ -78,12 +79,12 @@ static DECLARE_RWSEM(snd_pcm_link_rwsem);* and this may lead to a deadlock when the code path takes read sem * twice (e.g. one in snd_pcm_action_nonatomic() and another in * snd_pcm_stream_lock()). As a (suboptimal) workaround, let writer to -* spin until it gets the lock. +* sleep until all the readers are completed without blocking by writer. */ -static inline void down_write_nonblock (struct rw_semaphore *lock) +static inline void down_write_nonfifo (struct rw_semaphore *lock) {while (!down_write_trylock (lock)) -cond_resched (); +msleep (1 ); }/**
@@ -1825,7 +1826,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd) res = -ENOMEM ; goto _nolock; } -down_write_nonblock (&snd_pcm_link_rwsem); +down_write_nonfifo (&snd_pcm_link_rwsem);write_lock_irq (&snd_pcm_link_rwlock); if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN || substream->runtime->status->state != substream1->runtime->status->state ||
@@ -1872,7 +1873,7 @@ static int snd_pcm_unlink(struct snd_pcm_substream *substream)struct snd_pcm_substream *s;int res =0 ; -down_write_nonblock (&snd_pcm_link_rwsem); +down_write_nonfifo (&snd_pcm_link_rwsem);write_lock_irq (&snd_pcm_link_rwlock);if (!snd_pcm_stream_linked (substream)) { res = -EALREADY ;
@@ -2224,7 +2225,8 @@ int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream)static void pcm_release_private (struct snd_pcm_substream *substream) { -snd_pcm_unlink (substream); +if (snd_pcm_stream_linked (substream)) +snd_pcm_unlink (substream); }void snd_pcm_release_substream (struct snd_pcm_substream *substream)
sound/isa/wss/wss_lib.c +0 -2
@@ -1531,7 +1531,6 @@ static int snd_wss_playback_open(struct snd_pcm_substream *substream)if (err <0 ) {if (chip->release_dma) chip->release_dma (chip, chip->dma_private_data, chip->dma1); -snd_free_pages (runtime->dma_area, runtime->dma_bytes);return err; } chip->playback_substream = substream;
@@ -1572,7 +1571,6 @@ static int snd_wss_capture_open(struct snd_pcm_substream *substream)if (err <0 ) {if (chip->release_dma) chip->release_dma (chip, chip->dma_private_data, chip->dma2); -snd_free_pages (runtime->dma_area, runtime->dma_bytes);return err; } chip->capture_substream = substream;
sound/pci/ac97/ac97_codec.c +1 -1
@@ -824,7 +824,7 @@ static int snd_ac97_put_spsa(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ {struct snd_ac97 *ac97 =snd_kcontrol_chip (kcontrol);int reg = kcontrol->private_value &0xff ; -int shift = (kcontrol->private_value >>8 ) &0xff ; +int shift = (kcontrol->private_value >>8 ) &0x0f ;int mask = (kcontrol->private_value >>16 ) &0xff ;// int invert = (kcontrol->private_value >> 24) & 0xff; unsigned short value, old, new;
sound/pci/hda/hda_intel.c +4 -0
@@ -2363,6 +2363,10 @@ static const struct pci_device_id azx_ids[] = {/* AMD Hudson */ { PCI_DEVICE(0x1022, 0x780d), .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB }, + /* AMD Stoney */ + { PCI_DEVICE(0x1022, 0x157a), + .driver_data =AZX_DRIVER_GENERIC |AZX_DCAPS_PRESET_ATI_SB | + AZX_DCAPS_PM_RUNTIME }, /* AMD Raven */ { PCI_DEVICE(0x1022, 0x15e3), .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB |
sound/pci/trident/trident.c +1 -1
@@ -123,7 +123,7 @@ static int snd_trident_probe(struct pci_dev *pci, }else {strcpy (card->shortname,"Trident " ); } -strcat (card->shortname, card->driver); +strcat (card->shortname, str);sprintf (card->longname,"%s PCI Audio at 0x%lx, irq %d" , card->shortname, trident->port, trident->irq);
sound/sparc/cs4231.c +2 -6
@@ -1146,10 +1146,8 @@ static int snd_cs4231_playback_open(struct snd_pcm_substream *substream) runtime->hw = snd_cs4231_playback; err =snd_cs4231_open (chip,CS4231_MODE_PLAY ); -if (err <0 ) { -snd_free_pages (runtime->dma_area, runtime->dma_bytes); +if (err <0 )return err; - } chip->playback_substream = substream; chip->p_periods_sent =0 ;snd_pcm_set_sync (substream);
@@ -1167,10 +1165,8 @@ static int snd_cs4231_capture_open(struct snd_pcm_substream *substream) runtime->hw = snd_cs4231_capture; err =snd_cs4231_open (chip,CS4231_MODE_RECORD ); -if (err <0 ) { -snd_free_pages (runtime->dma_area, runtime->dma_bytes); +if (err <0 )return err; - } chip->capture_substream = substream; chip->c_periods_sent =0 ;snd_pcm_set_sync (substream);
sound/usb/card.c +4 -1
@@ -589,9 +589,12 @@ static int usb_audio_probe(struct usb_interface *intf, __error:if (chip) { +/* chip->active is inside the chip->card object, +* decrement before memory is possibly returned. +*/ +atomic_dec (&chip->active);if (!chip->num_interfaces)snd_card_free (chip->card); -atomic_dec (&chip->active); }mutex_unlock (®ister_mutex);return err;