Linux 4.4.160
Greg KH
maintainerI'm announcing the release of the 4.4.160 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
------------
Documentation/hwmon/ina2xx | 2 Makefile | 2 arch/arm/boot/dts/dra7.dtsi | 4 - arch/arm/mach-mvebu/pmsu.c | 6 - arch/arm64/include/asm/cpufeature.h | 8 +- arch/arm64/include/asm/jump_label.h | 4 - arch/arm64/include/asm/kvm_emulate.h | 5 + arch/arm64/include/asm/sysreg.h | 1 arch/arm64/kernel/cpufeature.c | 8 ++ arch/arm64/kvm/guest.c | 55 ++++++++++++++- arch/hexagon/include/asm/bitops.h | 4 - arch/hexagon/kernel/dma.c | 2 arch/powerpc/kernel/machine_kexec.c | 7 + arch/powerpc/kvm/book3s_64_mmu_hv.c | 2 arch/powerpc/platforms/powernv/pci-ioda.c | 2 arch/s390/mm/extmem.c | 4 - arch/x86/entry/entry_64.S | 4 - arch/x86/kernel/tsc_msr.c | 1 arch/x86/mm/numa_emulation.c | 2 crypto/ablkcipher.c | 2 crypto/blkcipher.c | 1 drivers/block/floppy.c | 3 drivers/bluetooth/btusb.c | 1 drivers/crypto/mxs-dcp.c | 53 ++++++++------ drivers/edac/i7core_edac.c | 22 ++++-- drivers/gpio/gpio-adp5588.c | 24 +++++- drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm204.c | 3 drivers/hid/hid-ntrig.c | 2 drivers/hwmon/adt7475.c | 14 ++- drivers/hwmon/ina2xx.c | 13 +++ drivers/i2c/busses/i2c-i801.c | 9 ++ drivers/i2c/busses/i2c-uniphier-f.c | 7 - drivers/i2c/busses/i2c-uniphier.c | 7 - drivers/infiniband/core/ucma.c | 6 + drivers/infiniband/ulp/srp/ib_srp.c | 6 - drivers/input/mouse/elantech.c | 2 drivers/md/dm-thin-metadata.c | 34 +++++++++ drivers/md/dm-thin.c | 73 +++++++++++++++++--- drivers/md/md-cluster.c | 19 ++--- drivers/md/raid10.c | 5 + drivers/media/i2c/soc_camera/ov772x.c | 2 drivers/media/platform/exynos4-is/fimc-isp-video.c | 11 ++- drivers/media/platform/fsl-viu.c | 38 ++++++---- drivers/media/platform/omap3isp/isp.c | 2 drivers/media/platform/s3c-camif/camif-capture.c | 2 drivers/media/usb/tm6000/tm6000-dvb.c | 5 + drivers/media/usb/uvc/uvc_video.c | 24 ++++-- drivers/media/v4l2-core/v4l2-event.c | 37 +++++----- drivers/media/v4l2-core/v4l2-fh.c | 2 drivers/misc/tsl2550.c | 2 drivers/misc/vmw_vmci/vmci_queue_pair.c | 4 - drivers/net/ethernet/cadence/macb.c | 2 drivers/net/ethernet/hisilicon/hns/hnae.h | 6 - drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 7 + drivers/net/ethernet/realtek/r8169.c | 9 +- drivers/net/wireless/ath/ath10k/htt_rx.c | 5 + drivers/net/wireless/mac80211_hwsim.c | 3 drivers/net/wireless/rndis_wlan.c | 2 drivers/net/wireless/ti/wlcore/cmd.c | 6 + drivers/power/reset/vexpress-poweroff.c | 12 ++- drivers/s390/net/qeth_l2_main.c | 2 drivers/s390/net/qeth_l3_main.c | 2 drivers/scsi/bnx2i/bnx2i_hwi.c | 2 drivers/scsi/ibmvscsi/ibmvscsi.c | 4 - drivers/spi/spi-rspi.c | 34 ++++++++- drivers/spi/spi-sh-msiof.c | 28 +++++++ drivers/spi/spi-tegra20-slink.c | 31 ++++++-- drivers/staging/android/ashmem.c | 6 + drivers/staging/rts5208/sd.c | 2 drivers/target/iscsi/iscsi_target_auth.c | 15 ---- drivers/target/iscsi/iscsi_target_tpg.c | 3 drivers/thermal/of-thermal.c | 7 + drivers/tty/serial/8250/serial_cs.c | 6 + drivers/tty/serial/cpm_uart/cpm_uart_core.c | 10 +- drivers/tty/serial/imx.c | 8 ++ drivers/usb/class/cdc-wdm.c | 2 drivers/usb/core/devio.c | 24 +++++- drivers/usb/core/driver.c | 28 +++---- drivers/usb/core/usb.c | 2 drivers/usb/gadget/udc/fotg210-udc.c | 15 ++-- drivers/usb/misc/yurex.c | 3 drivers/usb/serial/kobil_sct.c | 12 ++- drivers/usb/wusbcore/security.c | 2 drivers/uwb/hwa-rc.c | 1 drivers/xen/cpu_hotplug.c | 15 ++-- drivers/xen/events/events_base.c | 2 drivers/xen/manage.c | 6 + fs/cifs/cifs_unicode.c | 3 fs/cifs/cifssmb.c | 11 ++- fs/cifs/misc.c | 8 ++ fs/cifs/smb2ops.c | 2 fs/ext4/xattr.c | 5 + fs/nfsd/nfs4proc.c | 1 fs/ocfs2/dlm/dlmmaster.c | 4 - fs/proc/base.c | 14 +++ include/linux/platform_data/ina2xx.h | 2 include/linux/slub_def.h | 3 include/media/v4l2-fh.h | 1 kernel/module.c | 6 + kernel/time/alarmtimer.c | 3 lib/klist.c | 10 +- mm/madvise.c | 2 mm/slub.c | 6 - net/6lowpan/iphc.c | 1 net/mac80211/ibss.c | 22 +++--- net/mac80211/main.c | 26 +++++-- net/mac80211/mesh_hwmp.c | 4 + net/mac80211/mlme.c | 53 ++++++++++++++ net/wireless/nl80211.c | 1 net/wireless/util.c | 2 sound/aoa/core/gpio-feature.c | 4 - sound/pci/hda/hda_intel.c | 3 sound/pci/hda/patch_realtek.c | 1 sound/soc/soc-dapm.c | 7 + tools/perf/arch/powerpc/util/sym-handling.c | 4 - tools/vm/page-types.c | 6 - tools/vm/slabinfo.c | 4 - 117 files changed, 815 insertions(+), 286 deletions(-)
Aaron Ma (1):
Input: elantech - enable middle button of touchpad on ThinkPad P72
Akinobu Mita (2):
media: s3c-camif: ignore -ENOIOCTLCMD from v4l2_subdev_call for s_power
media: soc_camera: ov772x: correct setting of banding filter
Alan Stern (3):
USB: fix error handling in usb_driver_claim_interface()
USB: handle NULL config in usb_find_alt_setting()
USB: remove LPM management from usb_driver_claim_interface()
Alexey Dobriyan (1):
slub: make ->cpu_partial unsigned int
Alexey Kardashevskiy (1):
powerpc/powernv/ioda2: Reduce upper limit for DMA window size
Alexey Khoroshilov (1):
media: fsl-viu: fix error handling in viu_of_probe()
Alistair Strachan (1):
staging: android: ashmem: Fix mmap size validation
Andy Shevchenko (1):
x86/tsc: Add missing header to tsc_msr.c
Andy Whitcroft (1):
floppy: Do not copy a kernel pointer to user memory in FDGETPRM ioctl
Anson Huang (1):
thermal: of-thermal: disable passive polling when thermal zone is disabled
Anton Vasilyev (2):
uwb: hwa-rc: fix memory leak at probe
usb: gadget: fotg210-udc: Fix memory leak of fotg210->ep[i]
Arunk Khandavalli (1):
cfg80211: nl80211_update_ft_ies() to validate NL80211_ATTR_IE
Ashish Samant (1):
ocfs2: fix locking for res->tracking and dlm->tracking_list
Aurelien Aptel (1):
smb2: fix missing files in root share directory listing
Bart Van Assche (3):
scsi: target/iscsi: Make iscsit_ta_authentication() respect the output buffer size
scsi: klist: Make it safe to use klists in atomic context
IB/srp: Avoid that sg_reset -d ${srp_device} triggers an infinite loop
Ben Greear (1):
ath10k: protect ath10k_htt_rx_ring_free with rx_ring.lock
Ben Hutchings (1):
USB: yurex: Check for truncation in yurex_read()
Ben Skeggs (1):
drm/nouveau/TBDdevinit: don't fail when PMU/PRE_OS is missing from VBIOS
Bo Chen (2):
e1000: check on netif_running() before calling e1000_up()
e1000: ensure to free old tx/rx rings in set_ringparam()
Breno Leitao (1):
scsi: ibmvscsi: Improve strings handling
Christophe Leroy (1):
serial: cpm_uart: return immediately from console poll
Colin Ian King (1):
staging: rts5208: fix missing error check on call to rtsx_write_register
Dan Carpenter (5):
vmci: type promotion bug in qp_host_get_user_memory()
rndis_wlan: potential buffer overflow in rndis_wlan_auth_indication()
hwmon: (adt7475) Make adt7475_read_word() return errors
cfg80211: fix a type issue in ieee80211_chandef_to_operating_class()
cifs: read overflow in is_valid_oplock_break()
Dan Williams (1):
x86/numa_emulation: Fix emulated-to-physical node mapping
Danek Duvall (2):
mac80211: correct use of IEEE80211_VHT_CAP_RXSTBC_X
mac80211_hwsim: correct use of IEEE80211_VHT_CAP_RXSTBC_XDaniel Black (1):
mm: madvise(MADV_DODUMP): allow hugetlbfs pages
Dave Martin (1):
arm64: KVM: Tighten guest core register access from userspace
Emmanuel Grumbach (2):
mac80211: fix a race between restart and CSA flows
mac80211: shorten the IBSS debug messages
Ethan Tuttle (1):
ARM: mvebu: declare asm symbols as character arrays in pmsu.c
Gaku Inami (1):
spi: sh-msiof: Fix invalid SPI use during system suspend
Geert Uytterhoeven (2):
spi: rspi: Fix invalid SPI use during system suspend
spi: rspi: Fix interrupted DMA transfers
Greg Kroah-Hartman (1):
Linux 4.4.160
Guoqing Jiang (1):
md-cluster: clear another node's suspend_area after the copy is finished
Hari Bathini (1):
powerpc/kdump: Handle crashkernel memory reservation failure
Hiromitsu Yamasaki (1):
spi: sh-msiof: Fix handling of write value for SISTR register
Huazhong Tan (1):
net: hns: fix length and page_offset overflow when CONFIG_ARM64_64K_PAGES
Ilan Peer (1):
mac80211: Fix station bandwidth setting after channel switch
J. Bruce Fields (1):
nfsd: fix corrupted reply to badly ordered compound
Jan Beulich (1):
x86/entry/64: Add two more instruction suffixes
Jann Horn (2):
RDMA/ucma: check fd type in ucma_migrate_id()
proc: restrict kernel stack dumps to root
Javier Martinez Canillas (1):
media: omap3isp: zero-initialize the isp cam_xclk{a,b} initial data
Jessica Yu (1):
module: exclude SHN_UNDEF symbols from kallsyms api
Jia-Ju Bai (1):
net: cadence: Fix a sleep-in-atomic-context bug in macb_halt_tx()
Jian-Hong Pan (1):
Bluetooth: Add a new Realtek 8723DE ID 0bda:b009
Joe Thornber (1):
dm thin metadata: try to avoid ever aborting transactions
Johan Hovold (2):
USB: serial: kobil_sct: fix modem-status error handling EDAC, i7core: Fix memleaks and use-after-free on probe and remove
Jon Kuhn (1):
fs/cifs: don't translate SFM_SLASH (U+F026) to backslash
Josh Abraham (1):
xen: fix GCC warning and remove duplicate EVTCHN_ROW/EVTCHN_COL usage
Julia Lawall (1):
usb: wusbcore: security: cast sizeof to int for comparison
Julian Wiedmann (1):
s390/qeth: don't dump past end of unknown HW header
Kai-Heng Feng (3):
ALSA: hda: Add AZX_DCAPS_PM_RUNTIME for AMD Raven Ridge
r8169: Clear RTL_FLAG_TASK_*_PENDING when clearing RTL_FLAG_TASK_ENABLED
ALSA: hda/realtek - Cannot adjust speaker's volume on Dell XPS 27 7760
Kevin Hilman (1):
ARM: dts: dra7: fix DCAN node addresses
Leonard Crestez (1):
crypto: mxs-dcp - Fix wait logic on chan threads
Liam Girdwood (1):
ASoC: dapm: Fix potential DAI widget pointer deref when linking DAIs
Lothar Felten (1):
hwmon: (ina2xx) fix sysfs shunt resistor read access
Marc Zyngier (1):
arm64: KVM: Sanitize PSTATE.M when being set from userspace
Marcel Ziswiler (1):
spi: tegra20-slink: explicitly enable/disable clock
Masahiro Yamada (2):
i2c: uniphier: issue STOP only for last message or I2C_M_STOP
i2c: uniphier-f: issue STOP only for last message or I2C_M_STOP
Matt Ranostay (1):
tsl2550: fix lux1_input error in low light
Michael Hennerich (1):
gpio: adp5588: Fix sleep-in-atomic-context bug
Michael Scott (1):
6lowpan: iphc: reset mac_header after decompress to fix panic
Miguel Ojeda (1):
arm64: jump_label.h: use asm_volatile_goto macro instead of "asm goto"
Mika Westerberg (1):
i2c: i801: Allow ACPI AML access I/O ports not reserved for SMBus
Mike Snitzer (1):
dm thin metadata: fix __udivdi3 undefined on 32-bit
Naoya Horiguchi (2):
tools/vm/slabinfo.c: fix sign-compare warning tools/vm/page-types.c: fix "defined but not used" warning
Nicholas Mc Guire (1):
ALSA: snd-aoa: add of_node_put() in error path
Olaf Hering (1):
xen: avoid crash in disable_hotplug_cpu
Oliver Neukum (2):
USB: usbdevfs: sanitize flags more
USB: usbdevfs: restore warning for nonsensical flags
Paul Mackerras (1):
KVM: PPC: Book3S HV: Don't truncate HPTE index in xlate function
Randy Dunlap (2):
arch/hexagon: fix kernel/dma.c build warning
hexagon: modify ffs() and fls() to return int
Sakari Ailus (1):
media: v4l: event: Prevent freeing event subscriptions while accessed
Sandipan Das (1):
perf probe powerpc: Ignore SyS symbols irrespective of endianness
Sebastian Andrzej Siewior (1):
Revert "usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt()"
Stafford Horne (1):
crypto: skcipher - Fix -Wstringop-truncation warnings
Stephen Rothwell (1):
fs/cifs: suppress a string overflow warning
Sudeep Holla (1):
power: vexpress: fix corruption in notifier registration
Suzuki K Poulose (1):
arm64: cpufeature: Track 32bit EL0 support
Sylwester Nawrocki (1):
media: exynos4-is: Prevent NULL pointer dereference in __isp_video_try_fmt()
Theodore Ts'o (1):
ext4: never move the system.data xattr out of the inode body
Thomas Gleixner (1):
alarmtimer: Prevent overflow for relative nanosleep
Tony Lindgren (1):
wlcore: Add missing PM call for wlcore_cmd_wait_for_event_or_timeout()
Uwe Kleine-König (1):
serial: imx: restore handshaking irq for imx1
Vasily Gorbik (1):
s390/extmem: fix gcc 8 stringop-overflow warning
Vincent Pelletier (1):
scsi: target: iscsi: Use bin2hex instead of a re-implementation
Vitaly Kuznetsov (1):
xen/manage: don't complain about an empty value in control/sysrq node
Xiao Ni (1):
RAID10 BUG_ON in raise_barrier when force is true and conf->barrier is 0
Yuan-Chi Pang (1):
mac80211: mesh: fix HWMP sequence numbering to follow standard
Zhouyang Jia (4):
drivers/tty: add error handling for pcmcia_loop_config
media: tm6000: add error handling for dvb_register_adapter
HID: hid-ntrig: add error handling for sysfs_create_group
scsi: bnx2i: add error handling for ioremap_nocache
ming_qian (1):
media: uvcvideo: Support realtek's UVC 1.5 device
Greg KH
maintainerDocumentation/hwmon/ina2xx +1 -1
@@ -32,7 +32,7 @@ Supported chips: Datasheet: Publicly available at the Texas Instruments website http://www.ti.com/ -Author: Lothar Felten <[email protected]> +Author: Lothar Felten <[email protected]> Description -----------
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 4 -SUBLEVEL = 159 +SUBLEVEL = 160 EXTRAVERSION = NAME = Blurry Fish Butt
arch/arm/boot/dts/dra7.dtsi +2 -2
@@ -1549,7 +1549,7 @@ }; }; - dcan1: can@481cc000 { + dcan1: can@4ae3c000 { compatible = "ti,dra7-d_can"; ti,hwmods = "dcan1"; reg = <0x4ae3c000 0x2000>;
@@ -1559,7 +1559,7 @@ status = "disabled"; }; - dcan2: can@481d0000 { + dcan2: can@48480000 { compatible = "ti,dra7-d_can"; ti,hwmods = "dcan2"; reg = <0x48480000 0x2000>;
arch/arm/mach-mvebu/pmsu.c +3 -3
@@ -117,8 +117,8 @@ void mvebu_pmsu_set_cpu_boot_addr(int hw_cpu, void *boot_addr) PMSU_BOOT_ADDR_REDIRECT_OFFSET(hw_cpu)); } -extern unsigned char mvebu_boot_wa_start; -extern unsigned char mvebu_boot_wa_end; +extern unsigned char mvebu_boot_wa_start[]; +extern unsigned char mvebu_boot_wa_end[];/* * This function sets up the boot address workaround needed for SMP
@@ -131,7 +131,7 @@ int mvebu_setup_boot_addr_wa(unsigned int crypto_eng_target, phys_addr_t resume_addr_reg) {void __iomem *sram_virt_base; -u32 code_len = &mvebu_boot_wa_end - &mvebu_boot_wa_start; +u32 code_len = mvebu_boot_wa_end - mvebu_boot_wa_start;mvebu_mbus_del_window (BOOTROM_BASE ,BOOTROM_SIZE ); mvebu_mbus_add_window_by_id(crypto_eng_target, crypto_eng_attribute,
arch/arm64/include/asm/cpufeature.h +7 -1
@@ -31,8 +31,9 @@#define ARM64_WORKAROUND_CAVIUM_23154 6#define ARM64_WORKAROUND_834220 7#define ARM64_WORKAROUND_CAVIUM_27456 8 +#define ARM64_HAS_32BIT_EL0 9 -#define ARM64_NCAPS 9 +#define ARM64_NCAPS 10#ifndef __ASSEMBLY__
@@ -180,6 +181,11 @@ static inline bool cpu_supports_mixed_endian_el0(void)return id_aa64mmfr0_mixed_endian_el0 (read_cpuid (ID_AA64MMFR0_EL1 )); } +static inline bool system_supports_32bit_el0 (void ) +{ +return cpus_have_cap (ARM64_HAS_32BIT_EL0 ); +} +static inline bool system_supports_mixed_endian_el0 (void ) {return id_aa64mmfr0_mixed_endian_el0 (read_system_reg (SYS_ID_AA64MMFR0_EL1 ));
arch/arm64/include/asm/jump_label.h +2 -2
@@ -28,7 +28,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool branch) { - asm goto("1: nop\n\t" +asm_volatile_goto ("1: nop\n\t" ".pushsection __jump_table, \"aw\"\n\t" ".align 3\n\t" ".quad 1b, %l[l_yes], %c0\n\t"
@@ -42,7 +42,7 @@ l_yes: static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) { - asm goto("1: b %l[l_yes]\n\t" +asm_volatile_goto ("1: b %l[l_yes]\n\t" ".pushsection __jump_table, \"aw\"\n\t" ".align 3\n\t" ".quad 1b, %l[l_yes], %c0\n\t"
arch/arm64/include/asm/kvm_emulate.h +5 -0
@@ -41,6 +41,11 @@ void kvm_inject_undefined(struct kvm_vcpu *vcpu);void kvm_inject_dabt (struct kvm_vcpu *vcpu,unsigned long addr);void kvm_inject_pabt (struct kvm_vcpu *vcpu,unsigned long addr); +static inline bool vcpu_el1_is_32bit (struct kvm_vcpu *vcpu) +{ +return !(vcpu->arch.hcr_el2 &HCR_RW ); +} +static inline void vcpu_reset_hcr (struct kvm_vcpu *vcpu) { vcpu->arch.hcr_el2 =HCR_GUEST_FLAGS ;
arch/arm64/include/asm/sysreg.h +1 -0
@@ -109,6 +109,7 @@#define ID_AA64PFR0_ASIMD_SUPPORTED 0x0#define ID_AA64PFR0_EL1_64BIT_ONLY 0x1#define ID_AA64PFR0_EL0_64BIT_ONLY 0x1 +#define ID_AA64PFR0_EL0_32BIT_64BIT 0x2/* id_aa64mmfr0 */ #define ID_AA64MMFR0_TGRAN4_SHIFT 28
arch/arm64/kernel/cpufeature.c +8 -0
@@ -653,6 +653,14 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .min_field_value = 2, },#endif /* CONFIG_AS_LSE && CONFIG_ARM64_LSE_ATOMICS */ + { + .desc = "32-bit EL0 Support", + .capability = ARM64_HAS_32BIT_EL0, + .matches = has_cpuid_feature, + .sys_reg = SYS_ID_AA64PFR0_EL1, + .field_pos = ID_AA64PFR0_EL0_SHIFT, + .min_field_value = ID_AA64PFR0_EL0_32BIT_64BIT, + }, {}, };
arch/arm64/kvm/guest.c +54 -1
89 lines not on this page · raw message
arch/hexagon/include/asm/bitops.h +2 -2
@@ -211,7 +211,7 @@ static inline long ffz(int x)* This is defined the same way as ffs. * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. */ -static inline long fls (int x) +static inline int fls (int x) {int r;
@@ -232,7 +232,7 @@ static inline long fls(int x)* the libc and compiler builtin ffs routines, therefore * differs in spirit from the above ffz (man ffs). */ -static inline long ffs (int x) +static inline int ffs (int x) {int r;
arch/hexagon/kernel/dma.c +1 -1
@@ -68,7 +68,7 @@ static void *hexagon_dma_alloc_coherent(struct device *dev, size_t size,panic ("Can't create %s() memory pool!" , __func__); else gen_pool_add(coherent_pool, -pfn_to_virt (max_low_pfn ), + (unsigned long )pfn_to_virt (max_low_pfn ), hexagon_coherent_pool_size, -1); }
arch/powerpc/kernel/machine_kexec.c +6 -1
@@ -186,7 +186,12 @@ void __init reserve_crashkernel(void) (unsigned long )(crashk_res.start >>20 ), (unsigned long)(memblock_phys_mem_size() >> 20)); -memblock_reserve (crashk_res.start, crash_size); +if (!memblock_is_region_memory (crashk_res.start, crash_size) || +memblock_reserve (crashk_res.start, crash_size)) { +pr_err ("Failed to reserve memory for crashkernel!\n" ); + crashk_res.start = crashk_res.end =0 ; +return ; + } }int overlaps_crashkernel (unsigned long start,unsigned long size)
arch/powerpc/kvm/book3s_64_mmu_hv.c +1 -1
@@ -314,7 +314,7 @@ static int kvmppc_mmu_book3s_64_hv_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,unsigned long pp, key;unsigned long v, gr;__be64 *hptep; -int index; +long int index;int virtmode = vcpu->arch.shregs.msr & (data ?MSR_DR :MSR_IR );/* Get SLB entry */
arch/powerpc/platforms/powernv/pci-ioda.c +1 -1
@@ -2270,7 +2270,7 @@ static long pnv_pci_ioda2_table_alloc_pages(int nid, __u64 bus_offset, level_shift = entries_shift +3 ; level_shift =max_t (unsigned, level_shift,PAGE_SHIFT ); -if ((level_shift -3 ) * levels + page_shift >=60 ) +if ((level_shift -3 ) * levels + page_shift >=55 )return -EINVAL ;/* Allocate TCE table */
arch/s390/mm/extmem.c +2 -2
@@ -79,7 +79,7 @@ struct qin64 {struct dcss_segment {struct list_head list;char dcss_name[8 ]; -char res_name[15 ]; +char res_name[16 ];unsigned long start_addr;unsigned long end;atomic_t ref_count;
@@ -434,7 +434,7 @@ __segment_load (char *name, int do_nonshared, unsigned long *addr, unsigned longmemcpy (&seg->res_name, seg->dcss_name,8 );EBCASC (seg->res_name,8 ); seg->res_name[8 ] ='\0' ; -strncat (seg->res_name," (DCSS)" ,7 ); +strlcat (seg->res_name," (DCSS)" ,sizeof (seg->res_name)); seg->res->name = seg->res_name; rc = seg->vm_segtype; if (rc == SEG_TYPE_SC ||
arch/x86/entry/entry_64.S +2 -2
@@ -90,7 +90,7 @@ ENDPROC(native_usergs_sysret64) .endm .macro TRACE_IRQS_IRETQ_DEBUG - bt $9, EFLAGS(%rsp) /* interrupts off? */ + btl $9, EFLAGS(%rsp) /* interrupts off? */ jnc 1f TRACE_IRQS_ON_DEBUG 1:
@@ -620,7 +620,7 @@ retint_kernel: #ifdef CONFIG_PREEMPT /* Interrupts are off */ /* Check if we need preemption */ - bt $9, EFLAGS(%rsp) /* were interrupts off? */ + btl $9, EFLAGS(%rsp) /* were interrupts off? */ jnc 1f 0: cmpl $0, PER_CPU_VAR(__preempt_count) jnz 1f
arch/x86/kernel/tsc_msr.c +1 -0
@@ -21,6 +21,7 @@#include <asm/setup.h> #include <asm/apic.h> #include <asm/param.h> +#include <asm/tsc.h> /* CPU reference clock frequency: in KHz */ #define FREQ_83 83200
arch/x86/mm/numa_emulation.c +1 -1
@@ -60,7 +60,7 @@ static int __init emu_setup_memblk(struct numa_meminfo *ei, eb->nid = nid;if (emu_nid_to_phys[nid] ==NUMA_NO_NODE ) - emu_nid_to_phys[nid] = nid; + emu_nid_to_phys[nid] = pb->nid; pb->start += size;if (pb->start >= pb->end) {
crypto/ablkcipher.c +2 -0
@@ -384,6 +384,7 @@ static int crypto_ablkcipher_report(struct sk_buff *skb, struct crypto_alg *alg)strncpy (rblkcipher.type,"ablkcipher" ,sizeof (rblkcipher.type));strncpy (rblkcipher.geniv, alg->cra_ablkcipher.geniv ?:"<default>" ,sizeof (rblkcipher.geniv)); + rblkcipher.geniv[sizeof (rblkcipher.geniv) -1 ] ='\0' ; rblkcipher.blocksize = alg->cra_blocksize; rblkcipher.min_keysize = alg->cra_ablkcipher.min_keysize;
@@ -465,6 +466,7 @@ static int crypto_givcipher_report(struct sk_buff *skb, struct crypto_alg *alg)strncpy (rblkcipher.type,"givcipher" ,sizeof (rblkcipher.type));strncpy (rblkcipher.geniv, alg->cra_ablkcipher.geniv ?:"<built-in>" ,sizeof (rblkcipher.geniv)); + rblkcipher.geniv[sizeof (rblkcipher.geniv) -1 ] ='\0' ; rblkcipher.blocksize = alg->cra_blocksize; rblkcipher.min_keysize = alg->cra_ablkcipher.min_keysize;
crypto/blkcipher.c +1 -0
@@ -515,6 +515,7 @@ static int crypto_blkcipher_report(struct sk_buff *skb, struct crypto_alg *alg)strncpy (rblkcipher.type,"blkcipher" ,sizeof (rblkcipher.type));strncpy (rblkcipher.geniv, alg->cra_blkcipher.geniv ?:"<default>" ,sizeof (rblkcipher.geniv)); + rblkcipher.geniv[sizeof (rblkcipher.geniv) -1 ] ='\0' ; rblkcipher.blocksize = alg->cra_blocksize; rblkcipher.min_keysize = alg->cra_blkcipher.min_keysize;
drivers/block/floppy.c +3 -0
@@ -3459,6 +3459,9 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int (struct floppy_struct **)&outparam);if (ret)return ret; +memcpy (&inparam.g, outparam, + offsetof(struct floppy_struct , name)); + outparam = &inparam.g;break ;case FDMSGON :UDP ->flags |=FTD_MSG ;
drivers/bluetooth/btusb.c +1 -0
@@ -340,6 +340,7 @@ static const struct usb_device_id blacklist_table[] = { { USB_DEVICE(0x7392, 0xa611), .driver_info = BTUSB_REALTEK }, /* Additional Realtek 8723DE Bluetooth devices */ + { USB_DEVICE(0x0bda, 0xb009), .driver_info = BTUSB_REALTEK }, { USB_DEVICE(0x2ff8, 0xb011), .driver_info = BTUSB_REALTEK },/* Additional Realtek 8821AE Bluetooth devices */
drivers/crypto/mxs-dcp.c +30 -23
111 lines not on this page · raw message
drivers/edac/i7core_edac.c +15 -7
@@ -1187,15 +1187,14 @@ static int i7core_create_sysfs_devices(struct mem_ctl_info *mci) rc =device_add (pvt->addrmatch_dev);if (rc <0 ) -return rc; + goto err_put_addrmatch;if (!pvt->is_registered) { pvt->chancounts_dev =kzalloc (sizeof (*pvt->chancounts_dev),GFP_KERNEL );if (!pvt->chancounts_dev) { -put_device (pvt->addrmatch_dev); -device_del (pvt->addrmatch_dev); -return -ENOMEM ; + rc = -ENOMEM ; + goto err_del_addrmatch; } pvt->chancounts_dev->type = &all_channel_counts_type;
@@ -1209,9 +1208,18 @@ static int i7core_create_sysfs_devices(struct mem_ctl_info *mci) rc =device_add (pvt->chancounts_dev);if (rc <0 ) -return rc; + goto err_put_chancounts; }return 0 ; + +err_put_chancounts: +put_device (pvt->chancounts_dev); +err_del_addrmatch: +device_del (pvt->addrmatch_dev); +err_put_addrmatch: +put_device (pvt->addrmatch_dev); + +return rc; }static void i7core_delete_sysfs_devices (struct mem_ctl_info *mci)
@@ -1221,11 +1229,11 @@ static void i7core_delete_sysfs_devices(struct mem_ctl_info *mci)edac_dbg (1 ,"\n" );if (!pvt->is_registered) { -put_device (pvt->chancounts_dev);device_del (pvt->chancounts_dev); +put_device (pvt->chancounts_dev); } -put_device (pvt->addrmatch_dev);device_del (pvt->addrmatch_dev); +put_device (pvt->addrmatch_dev); }/****************************************************************************
drivers/gpio/gpio-adp5588.c +20 -4
@@ -41,6 +41,8 @@ struct adp5588_gpio {uint8_t int_en[3 ];uint8_t irq_mask[3 ];uint8_t irq_stat[3 ]; +uint8_t int_input_en[3 ]; +uint8_t int_lvl_cached[3 ]; };static int adp5588_gpio_read (struct i2c_client *client,u8 reg)
@@ -177,12 +179,28 @@ static void adp5588_irq_bus_sync_unlock(struct irq_data *d)struct adp5588_gpio *dev =irq_data_get_irq_chip_data (d);int i; -for (i =0 ; i <=ADP5588_BANK (ADP5588_MAXGPIO ); i++) +for (i =0 ; i <=ADP5588_BANK (ADP5588_MAXGPIO ); i++) { +if (dev->int_input_en[i]) { +mutex_lock (&dev->lock); + dev->dir[i] &= ~dev->int_input_en[i]; + dev->int_input_en[i] =0 ; +adp5588_gpio_write (dev->client,GPIO_DIR1 + i, + dev->dir[i]); +mutex_unlock (&dev->lock); + } + +if (dev->int_lvl_cached[i] != dev->int_lvl[i]) { + dev->int_lvl_cached[i] = dev->int_lvl[i]; +adp5588_gpio_write (dev->client,GPIO_INT_LVL1 + i, + dev->int_lvl[i]); + } +if (dev->int_en[i] ^ dev->irq_mask[i]) { dev->int_en[i] = dev->irq_mask[i];adp5588_gpio_write (dev->client,GPIO_INT_EN1 + i, dev->int_en[i]); } + }mutex_unlock (&dev->irq_lock); }
@@ -225,9 +243,7 @@ static int adp5588_irq_set_type(struct irq_data *d, unsigned int type)else return -EINVAL ; -adp5588_gpio_direction_input (&dev->gpio_chip, gpio); -adp5588_gpio_write (dev->client,GPIO_INT_LVL1 + bank, - dev->int_lvl[bank]); + dev->int_input_en[bank] |= bit;return 0 ; }
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm204.c +2 -1
@@ -161,7 +161,8 @@ gm204_devinit_post(struct nvkm_devinit *base, bool post) }/* load and execute some other ucode image (bios therm?) */ -return pmu_load (init,0x01 , post,NULL ,NULL ); +pmu_load (init,0x01 , post,NULL ,NULL ); +return 0 ; } static const struct nvkm_devinit_func
drivers/hid/hid-ntrig.c +2 -0
@@ -955,6 +955,8 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) ret =sysfs_create_group (&hdev->dev.kobj, &ntrig_attribute_group); +if (ret) +hid_err (hdev,"cannot create sysfs group\n" );return 0 ; err_free:
drivers/hwmon/adt7475.c +9 -5
@@ -274,14 +274,18 @@ static inline u16 volt2reg(int channel, long volt, u8 bypass_attn)return clamp_val (reg,0 ,1023 ) & (0xff <<2 ); } -static u16 adt7475_read_word (struct i2c_client *client,int reg) +static int adt7475_read_word (struct i2c_client *client,int reg) { -u16 val; +int val1, val2; - val =i2c_smbus_read_byte_data (client, reg); - val |= (i2c_smbus_read_byte_data (client, reg +1 ) <<8 ); + val1 =i2c_smbus_read_byte_data (client, reg); +if (val1 <0 ) +return val1; + val2 =i2c_smbus_read_byte_data (client, reg +1 ); +if (val2 <0 ) +return val2; -return val; +return val1 | (val2 <<8 ); }static void adt7475_write_word (struct i2c_client *client,int reg,u16 val)
drivers/hwmon/ina2xx.c +11 -2
@@ -17,7 +17,7 @@* Bi-directional Current/Power Monitor with I2C Interface * Datasheet: http://www.ti.com/product/ina230 * -* Copyright (C) 2012 Lothar Felten <[email protected]> +* Copyright (C) 2012 Lothar Felten <[email protected]> * Thanks to Jan Volkering * * This program is free software; you can redistribute it and/or modify
@@ -328,6 +328,15 @@ static int ina2xx_set_shunt(struct ina2xx_data *data, long val)return 0 ; } +static ssize_t ina2xx_show_shunt (struct device *dev, +struct device_attribute *da, +char *buf) +{ +struct ina2xx_data *data =dev_get_drvdata (dev); + +return snprintf (buf,PAGE_SIZE ,"%li\n" , data->rshunt); +} +static ssize_t ina2xx_store_shunt (struct device *dev,struct device_attribute *da,const char *buf,size_t count)
@@ -402,7 +411,7 @@ static SENSOR_DEVICE_ATTR(power1_input, S_IRUGO, ina2xx_show_value, NULL,/* shunt resistance */ static SENSOR_DEVICE_ATTR(shunt_resistor, S_IRUGO | S_IWUSR, - ina2xx_show_value, ina2xx_store_shunt, + ina2xx_show_shunt, ina2xx_store_shunt, INA2XX_CALIBRATION);/* update interval (ina226 only) */
drivers/i2c/busses/i2c-i801.c +8 -1
@@ -1272,6 +1272,13 @@ static void i801_add_tco(struct i801_priv *priv) }#ifdef CONFIG_ACPI +static bool i801_acpi_is_smbus_ioport (const struct i801_priv *priv, +acpi_physical_address address) +{ +return address >= priv->smba && + address <=pci_resource_end (priv->pci_dev,SMBBAR ); +} +static acpi_status i801_acpi_io_handler (u32 function,acpi_physical_address address,u32 bits,u64 *value,void *handler_context,void *region_context)
@@ -1287,7 +1294,7 @@ i801_acpi_io_handler(u32 function, acpi_physical_address address, u32 bits,*/ mutex_lock (&priv->acpi_lock); -if (!priv->acpi_reserved) { +if (!priv->acpi_reserved &&i801_acpi_is_smbus_ioport (priv, address)) { priv->acpi_reserved = true;dev_warn (&pdev->dev,"BIOS is accessing SMBus registers\n" );
drivers/i2c/busses/i2c-uniphier-f.c +2 -5
@@ -394,11 +394,8 @@ static int uniphier_fi2c_master_xfer(struct i2c_adapter *adap,return ret;for (msg = msgs; msg < emsg; msg++) { -/* If next message is read, skip the stop condition */ -bool stop = !(msg +1 < emsg && msg[1 ].flags &I2C_M_RD ); -/* but, force it if I2C_M_STOP is set */ -if (msg->flags &I2C_M_STOP ) - stop = true; +/* Emit STOP if it is the last message or I2C_M_STOP is set. */ +bool stop = (msg +1 == emsg) || (msg->flags &I2C_M_STOP ); ret =uniphier_fi2c_master_xfer_one (adap, msg, stop);if (ret)
drivers/i2c/busses/i2c-uniphier.c +2 -5
@@ -247,11 +247,8 @@ static int uniphier_i2c_master_xfer(struct i2c_adapter *adap,return ret;for (msg = msgs; msg < emsg; msg++) { -/* If next message is read, skip the stop condition */ -bool stop = !(msg +1 < emsg && msg[1 ].flags &I2C_M_RD ); -/* but, force it if I2C_M_STOP is set */ -if (msg->flags &I2C_M_STOP ) - stop = true; +/* Emit STOP if it is the last message or I2C_M_STOP is set. */ +bool stop = (msg +1 == emsg) || (msg->flags &I2C_M_STOP ); ret =uniphier_i2c_master_xfer_one (adap, msg, stop);if (ret)
drivers/infiniband/core/ucma.c +6 -0
@@ -123,6 +123,8 @@ static DEFINE_MUTEX(mut);static DEFINE_IDR (ctx_idr);static DEFINE_IDR (multicast_idr); +static const struct file_operations ucma_fops; +static inline struct ucma_context *_ucma_find_context (int id,struct ucma_file *file) {
@@ -1535,6 +1537,10 @@ static ssize_t ucma_migrate_id(struct ucma_file *new_file, f =fdget (cmd.fd);if (!f.file)return -ENOENT ; +if (f.file->f_op != &ucma_fops) { + ret = -EINVAL ; + goto file_put; + }/* Validate current fd and prevent destruction of id. */ ctx =ucma_get_ctx (f.file->private_data, cmd.id);
drivers/infiniband/ulp/srp/ib_srp.c +3 -3
@@ -2594,7 +2594,7 @@ static int srp_reset_device(struct scsi_cmnd *scmnd) {struct srp_target_port *target =host_to_target (scmnd->device->host);struct srp_rdma_ch *ch; -int i; +int i, j;u8 status;shost_printk (KERN_ERR , target->scsi_host,"SRP reset_device called\n" );
@@ -2608,8 +2608,8 @@ static int srp_reset_device(struct scsi_cmnd *scmnd)for (i =0 ; i < target->ch_count; i++) { ch = &target->ch[i]; -for (i =0 ; i < target->req_ring_size; ++i) { -struct srp_request *req = &ch->req_ring[i]; +for (j =0 ; j < target->req_ring_size; ++j) { +struct srp_request *req = &ch->req_ring[j];srp_finish_req (ch, req, scmnd->device,DID_RESET <<16 ); }
drivers/input/mouse/elantech.c +2 -0
@@ -1180,6 +1180,8 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = {static const char *const middle_button_pnp_ids[] = {"LEN2131" ,/* ThinkPad P52 w/ NFC */ "LEN2132" ,/* ThinkPad P52 */ +"LEN2133" ,/* ThinkPad P72 w/ NFC */ +"LEN2134" ,/* ThinkPad P72 */ NULL };
drivers/md/dm-thin-metadata.c +33 -1
@@ -189,6 +189,12 @@ struct dm_pool_metadata {unsigned long flags;sector_t data_block_size; +/* +* We reserve a section of the metadata for commit overhead. +* All reported space does *not* include this. +*/ +dm_block_t metadata_reserve; +/* * Set if a transaction has to be aborted but the attempt to roll back * to the previous (good) transaction failed. The only pool metadata
@@ -827,6 +833,20 @@ static int __commit_transaction(struct dm_pool_metadata *pmd)return dm_tm_commit (pmd->tm, sblock); } +static void __set_metadata_reserve (struct dm_pool_metadata *pmd) +{ +int r; +dm_block_t total; +dm_block_t max_blocks =4096 ;/* 16M */ + + r =dm_sm_get_nr_blocks (pmd->metadata_sm, &total); +if (r) { +DMERR ("could not get size of metadata device" ); + pmd->metadata_reserve = max_blocks; + }else + pmd->metadata_reserve =min (max_blocks,div_u64 (total,10 )); +} +struct dm_pool_metadata *dm_pool_metadata_open (struct block_device *bdev,sector_t data_block_size,bool format_device)
@@ -860,6 +880,8 @@ struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev,return ERR_PTR (r); } +__set_metadata_reserve (pmd); +return pmd; }
@@ -1763,6 +1785,13 @@ int dm_pool_get_free_metadata_block_count(struct dm_pool_metadata *pmd,down_read (&pmd->root_lock);if (!pmd->fail_io) r =dm_sm_get_nr_free (pmd->metadata_sm, result); + +if (!r) { +if (*result < pmd->metadata_reserve) + *result =0 ; +else + *result -= pmd->metadata_reserve; + }up_read (&pmd->root_lock);return r;
@@ -1875,8 +1904,11 @@ int dm_pool_resize_metadata_dev(struct dm_pool_metadata *pmd, dm_block_t new_couint r = -EINVAL ;down_write (&pmd->root_lock); -if (!pmd->fail_io) +if (!pmd->fail_io) { r =__resize_space_map (pmd->metadata_sm, new_count); +if (!r) +__set_metadata_reserve (pmd); + }up_write (&pmd->root_lock);return r;
drivers/md/dm-thin.c +65 -8
141 lines not on this page · raw message
drivers/md/md-cluster.c +10 -9
@@ -239,15 +239,6 @@ static void recover_bitmaps(struct md_thread *thread)while (cinfo->recovery_map) { slot =fls64 ((u64 )cinfo->recovery_map) -1 ; -/* Clear suspend_area associated with the bitmap */ -spin_lock_irq (&cinfo->suspend_lock); -list_for_each_entry_safe (s, tmp, &cinfo->suspend_list, list) -if (slot == s->slot) { -list_del (&s->list); -kfree (s); - } -spin_unlock_irq (&cinfo->suspend_lock); -snprintf (str,64 ,"bitmap%04d" , slot); bm_lockres =lockres_init (mddev, str,NULL ,1 );if (!bm_lockres) {
@@ -266,6 +257,16 @@ static void recover_bitmaps(struct md_thread *thread)pr_err ("md-cluster: Could not copy data from bitmap %d\n" , slot); goto dlm_unlock; } + +/* Clear suspend_area associated with the bitmap */ +spin_lock_irq (&cinfo->suspend_lock); +list_for_each_entry_safe (s, tmp, &cinfo->suspend_list, list) +if (slot == s->slot) { +list_del (&s->list); +kfree (s); + } +spin_unlock_irq (&cinfo->suspend_lock); +if (hi >0 ) {/* TODO:Wait for current resync to get over */ set_bit (MD_RECOVERY_NEEDED , &mddev->recovery);
drivers/md/raid10.c +4 -1
@@ -4336,11 +4336,12 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr,allow_barrier (conf); } +raise_barrier (conf,0 ); read_more:/* Now schedule reads for blocks from sector_nr to last */ r10_bio =mempool_alloc (conf->r10buf_pool,GFP_NOIO ); r10_bio->state =0 ; -raise_barrier (conf, sectors_done !=0 ); +raise_barrier (conf,1 );atomic_set (&r10_bio->remaining,0 ); r10_bio->mddev = mddev; r10_bio->sector = sector_nr;
@@ -4445,6 +4446,8 @@ bio_full:if (sector_nr <= last) goto read_more; +lower_barrier (conf); +/* Now that we have done the whole section we can * update reshape_progress */
drivers/media/i2c/soc_camera/ov772x.c +1 -1
@@ -834,7 +834,7 @@ static int ov772x_set_params(struct ov772x_priv *priv,* set COM8 */ if (priv->band_filter) { - ret =ov772x_mask_set (client,COM8 ,BNDF_ON_OFF ,1 ); + ret =ov772x_mask_set (client,COM8 ,BNDF_ON_OFF ,BNDF_ON_OFF );if (!ret) ret =ov772x_mask_set (client,BDBASE ,0xff ,256 - priv->band_filter);
drivers/media/platform/exynos4-is/fimc-isp-video.c +8 -3
@@ -391,12 +391,17 @@ static void __isp_video_try_fmt(struct fimc_isp *isp,struct v4l2_pix_format_mplane *pixm, const struct fimc_fmt **fmt) { - *fmt =fimc_isp_find_format (&pixm->pixelformat,NULL ,2 ); + const struct fimc_fmt *__fmt; + + __fmt =fimc_isp_find_format (&pixm->pixelformat,NULL ,2 ); + +if (fmt) + *fmt = __fmt; pixm->colorspace =V4L2_COLORSPACE_SRGB ; pixm->field =V4L2_FIELD_NONE ; - pixm->num_planes = (*fmt)->memplanes; - pixm->pixelformat = (*fmt)->fourcc; + pixm->num_planes = __fmt->memplanes; + pixm->pixelformat = __fmt->fourcc;/* * TODO: double check with the docmentation these width/height * constraints are correct.
drivers/media/platform/fsl-viu.c +23 -15
@@ -1417,7 +1417,7 @@ static int viu_of_probe(struct platform_device *op) sizeof(struct viu_reg), DRV_NAME)) {dev_err (&op->dev,"Error while requesting mem region\n" ); ret = -EBUSY ; - goto err; + goto err_irq; }/* remap registers */
@@ -1425,7 +1425,7 @@ static int viu_of_probe(struct platform_device *op)if (!viu_regs) {dev_err (&op->dev,"Can't map register set\n" ); ret = -ENOMEM ; - goto err; + goto err_irq; }/* Prepare our private structure */
@@ -1433,7 +1433,7 @@ static int viu_of_probe(struct platform_device *op)if (!viu_dev) {dev_err (&op->dev,"Can't allocate private structure\n" ); ret = -ENOMEM ; - goto err; + goto err_irq; } viu_dev->vr = viu_regs;
@@ -1449,16 +1449,21 @@ static int viu_of_probe(struct platform_device *op) ret =v4l2_device_register (viu_dev->dev, &viu_dev->v4l2_dev);if (ret <0 ) {dev_err (&op->dev,"v4l2_device_register() failed: %d\n" , ret); - goto err; + goto err_irq; } ad =i2c_get_adapter (0 ); +if (!ad) { + ret = -EFAULT ; +dev_err (&op->dev,"couldn't get i2c adapter\n" ); + goto err_v4l2; + }v4l2_ctrl_handler_init (&viu_dev->hdl,5 );if (viu_dev->hdl.error) { ret = viu_dev->hdl.error;dev_err (&op->dev,"couldn't register control\n" ); - goto err_vdev; + goto err_i2c; }/* This control handler will inherit the control(s) from the sub-device(s). */
@@ -1476,7 +1481,7 @@ static int viu_of_probe(struct platform_device *op) vdev =video_device_alloc ();if (vdev ==NULL ) { ret = -ENOMEM ; - goto err_vdev; + goto err_hdl; } *vdev = viu_template;
@@ -1497,7 +1502,7 @@ static int viu_of_probe(struct platform_device *op) ret =video_register_device (viu_dev->vdev,VFL_TYPE_GRABBER ,-1 );if (ret <0 ) {video_device_release (viu_dev->vdev); - goto err_vdev; + goto err_unlock; }/* enable VIU clock */
@@ -1505,12 +1510,12 @@ static int viu_of_probe(struct platform_device *op)if (IS_ERR (clk)) {dev_err (&op->dev,"failed to lookup the clock!\n" ); ret =PTR_ERR (clk); - goto err_clk; + goto err_vdev; } ret =clk_prepare_enable (clk);if (ret) {dev_err (&op->dev,"failed to enable the clock!\n" ); - goto err_clk; + goto err_vdev; } viu_dev->clk = clk;
@@ -1521,7 +1526,7 @@ static int viu_of_probe(struct platform_device *op)if (request_irq (viu_dev->irq, viu_intr,0 ,"viu" , (void *)viu_dev)) {dev_err (&op->dev,"Request VIU IRQ failed.\n" ); ret = -ENODEV ; - goto err_irq; + goto err_clk; }mutex_unlock (&viu_dev->lock);
@@ -1529,16 +1534,19 @@ static int viu_of_probe(struct platform_device *op)dev_info (&op->dev,"Freescale VIU Video Capture Board\n" );return ret; -err_irq: -clk_disable_unprepare (viu_dev->clk); err_clk: -video_unregister_device (viu_dev->vdev); +clk_disable_unprepare (viu_dev->clk); err_vdev: -v4l2_ctrl_handler_free (&viu_dev->hdl); +video_unregister_device (viu_dev->vdev); +err_unlock:mutex_unlock (&viu_dev->lock); +err_hdl: +v4l2_ctrl_handler_free (&viu_dev->hdl); +err_i2c:i2c_put_adapter (ad); +err_v4l2:v4l2_device_unregister (&viu_dev->v4l2_dev); -err: +err_irq:irq_dispose_mapping (viu_irq);return ret; }
drivers/media/platform/omap3isp/isp.c +1 -1
@@ -303,7 +303,7 @@ static struct clk *isp_xclk_src_get(struct of_phandle_args *clkspec, void *data)static int isp_xclk_init (struct isp_device *isp) {struct device_node *np = isp->dev->of_node; -struct clk_init_data init; +struct clk_init_data init = {0 };unsigned int i;for (i =0 ; i <ARRAY_SIZE (isp->xclks); ++i)
drivers/media/platform/s3c-camif/camif-capture.c +2 -0
@@ -117,6 +117,8 @@ static int sensor_set_power(struct camif_dev *camif, int on)if (camif->sensor.power_count == !on) err =v4l2_subdev_call (sensor->sd, core, s_power, on); +if (err == -ENOIOCTLCMD ) + err =0 ;if (!err) sensor->power_count += on ?1 :-1 ;
drivers/media/usb/tm6000/tm6000-dvb.c +5 -0
@@ -275,6 +275,11 @@ static int register_dvb(struct tm6000_core *dev) ret =dvb_register_adapter (&dvb->adapter,"Trident TVMaster 6000 DVB-T" ,THIS_MODULE , &dev->udev->dev, adapter_nr); +if (ret <0 ) { +pr_err ("tm6000: couldn't register the adapter!\n" ); + goto err; + } + dvb->adapter.priv = dev;if (dvb->frontend) {
drivers/media/usb/uvc/uvc_video.c +18 -6
@@ -163,14 +163,27 @@ static void uvc_fixup_video_ctrl(struct uvc_streaming *stream, } } +static size_t uvc_video_ctrl_size (struct uvc_streaming *stream) +{ +/* +* Return the size of the video probe and commit controls, which depends +* on the protocol version. +*/ +if (stream->dev->uvc_version <0x0110 ) +return 26 ; +else if (stream->dev->uvc_version <0x0150 ) +return 34 ; +else +return 48 ; +} +static int uvc_get_video_ctrl (struct uvc_streaming *stream,struct uvc_streaming_control *ctrl,int probe,__u8 query) { +__u16 size =uvc_video_ctrl_size (stream);__u8 *data; -__u16 size;int ret; - size = stream->dev->uvc_version >=0x0110 ?34 :26 ;if ((stream->dev->quirks &UVC_QUIRK_PROBE_DEF ) && query ==UVC_GET_DEF )return -EIO ;
@@ -225,7 +238,7 @@ static int uvc_get_video_ctrl(struct uvc_streaming *stream, ctrl->dwMaxVideoFrameSize =get_unaligned_le32 (&data[18 ]); ctrl->dwMaxPayloadTransferSize =get_unaligned_le32 (&data[22 ]); -if (size ==34 ) { +if (size >=34 ) { ctrl->dwClockFrequency =get_unaligned_le32 (&data[26 ]); ctrl->bmFramingInfo = data[30 ]; ctrl->bPreferedVersion = data[31 ];
@@ -254,11 +267,10 @@ out:static int uvc_set_video_ctrl (struct uvc_streaming *stream,struct uvc_streaming_control *ctrl,int probe) { +__u16 size =uvc_video_ctrl_size (stream);__u8 *data; -__u16 size;int ret; - size = stream->dev->uvc_version >=0x0110 ?34 :26 ; data =kzalloc (size,GFP_KERNEL );if (data ==NULL )return -ENOMEM ;
@@ -275,7 +287,7 @@ static int uvc_set_video_ctrl(struct uvc_streaming *stream,put_unaligned_le32 (ctrl->dwMaxVideoFrameSize, &data[18 ]);put_unaligned_le32 (ctrl->dwMaxPayloadTransferSize, &data[22 ]); -if (size ==34 ) { +if (size >=34 ) {put_unaligned_le32 (ctrl->dwClockFrequency, &data[26 ]); data[30 ] = ctrl->bmFramingInfo; data[31 ] = ctrl->bPreferedVersion;
drivers/media/v4l2-core/v4l2-event.c +19 -18
@@ -119,14 +119,6 @@ static void __v4l2_event_queue_fh(struct v4l2_fh *fh, const struct v4l2_event *eif (sev ==NULL )return ; -/* -* If the event has been added to the fh->subscribed list, but its -* add op has not completed yet elems will be 0, treat this as -* not being subscribed. -*/ -if (!sev->elems) -return ; -/* Increase event sequence number on fh. */ fh->sequence++;
@@ -212,6 +204,7 @@ int v4l2_event_subscribe(struct v4l2_fh *fh,struct v4l2_subscribed_event *sev, *found_ev;unsigned long flags;unsigned i; +int ret =0 ;if (sub->type ==V4L2_EVENT_ALL )return -EINVAL ;
@@ -229,31 +222,36 @@ int v4l2_event_subscribe(struct v4l2_fh *fh, sev->flags = sub->flags; sev->fh = fh; sev->ops = ops; + sev->elems = elems; + +mutex_lock (&fh->subscribe_lock);spin_lock_irqsave (&fh->vdev->fh_lock, flags); found_ev =v4l2_event_subscribed (fh, sub->type, sub->id); -if (!found_ev) -list_add (&sev->list, &fh->subscribed);spin_unlock_irqrestore (&fh->vdev->fh_lock, flags);if (found_ev) { +/* Already listening */ kfree (sev); -return 0 ;/* Already listening */ + goto out_unlock; }if (sev->ops && sev->ops->add) { -int ret = sev->ops->add (sev, elems); + ret = sev->ops->add (sev, elems);if (ret) { - sev->ops =NULL ; -v4l2_event_unsubscribe (fh, sub); -return ret; +kfree (sev); + goto out_unlock; } } -/* Mark as ready for use */ - sev->elems = elems; +spin_lock_irqsave (&fh->vdev->fh_lock, flags); +list_add (&sev->list, &fh->subscribed); +spin_unlock_irqrestore (&fh->vdev->fh_lock, flags); -return 0 ; +out_unlock: +mutex_unlock (&fh->subscribe_lock); + +return ret; }EXPORT_SYMBOL_GPL (v4l2_event_subscribe);
@@ -292,6 +290,8 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh,return 0 ; } +mutex_lock (&fh->subscribe_lock); +spin_lock_irqsave (&fh->vdev->fh_lock, flags); sev =v4l2_event_subscribed (fh, sub->type, sub->id);
@@ -310,6 +310,7 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh, sev->ops->del (sev);kfree (sev); +mutex_unlock (&fh->subscribe_lock);return 0 ; }
drivers/media/v4l2-core/v4l2-fh.c +2 -0
@@ -49,6 +49,7 @@ void v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev)INIT_LIST_HEAD (&fh->available);INIT_LIST_HEAD (&fh->subscribed); fh->sequence =-1 ; +mutex_init (&fh->subscribe_lock); }EXPORT_SYMBOL_GPL (v4l2_fh_init);
@@ -93,6 +94,7 @@ void v4l2_fh_exit(struct v4l2_fh *fh)if (fh->vdev ==NULL )return ;v4l2_event_unsubscribe_all (fh); +mutex_destroy (&fh->subscribe_lock); fh->vdev =NULL ; }EXPORT_SYMBOL_GPL (v4l2_fh_exit);
drivers/misc/tsl2550.c +1 -1
@@ -177,7 +177,7 @@ static int tsl2550_calculate_lux(u8 ch0, u8 ch1) }else lux =0 ; else - return -EAGAIN; + return 0;/* LUX range check */ return lux >TSL2550_MAX_LUX ?TSL2550_MAX_LUX : lux;
drivers/misc/vmw_vmci/vmci_queue_pair.c +2 -2
@@ -755,7 +755,7 @@ static int qp_host_get_user_memory(u64 produce_uva, retval =get_user_pages_fast ((uintptr_t ) produce_uva, produce_q->kernel_if->num_pages,1 , produce_q->kernel_if->u.h.header_page); -if (retval < produce_q->kernel_if->num_pages) { +if (retval < (int )produce_q->kernel_if->num_pages) {pr_debug ("get_user_pages_fast(produce) failed (retval=%d)" , retval); qp_release_pages(produce_q->kernel_if->u.h.header_page,
@@ -767,7 +767,7 @@ static int qp_host_get_user_memory(u64 produce_uva, retval =get_user_pages_fast ((uintptr_t ) consume_uva, consume_q->kernel_if->num_pages,1 , consume_q->kernel_if->u.h.header_page); -if (retval < consume_q->kernel_if->num_pages) { +if (retval < (int )consume_q->kernel_if->num_pages) {pr_debug ("get_user_pages_fast(consume) failed (retval=%d)" , retval); qp_release_pages(consume_q->kernel_if->u.h.header_page,
drivers/net/ethernet/cadence/macb.c +1 -1
@@ -523,7 +523,7 @@ static int macb_halt_tx(struct macb *bp)if (!(status &MACB_BIT (TGO )))return 0 ; -usleep_range (10 ,250 ); +udelay (250 ); }while (time_before (halt_time, timeout));return -ETIMEDOUT ;
drivers/net/ethernet/hisilicon/hns/hnae.h +3 -3
@@ -171,10 +171,10 @@ struct hnae_desc_cb {/* priv data for the desc, e.g. skb when use with ip stack*/ void *priv; -u16 page_offset; -u16 reuse_flag; +u32 page_offset; +u32 length;/* length of the buffer */ -u16 length;/* length of the buffer */ +u16 reuse_flag;/* desc type, used by the ring user to mark the type of the priv data */ u16 type;
drivers/net/ethernet/intel/e1000/e1000_ethtool.c +4 -3
@@ -645,14 +645,14 @@ static int e1000_set_ringparam(struct net_device *netdev, adapter->tx_ring = tx_old;e1000_free_all_rx_resources (adapter);e1000_free_all_tx_resources (adapter); -kfree (tx_old); -kfree (rx_old); adapter->rx_ring = rxdr; adapter->tx_ring = txdr; err =e1000_up (adapter);if (err) goto err_setup; } +kfree (tx_old); +kfree (rx_old);clear_bit (__E1000_RESETTING, &adapter->flags);return 0 ;
@@ -665,7 +665,8 @@ err_setup_rx: err_alloc_rx:kfree (txdr); err_alloc_tx: -e1000_up (adapter); +if (netif_running (adapter->netdev)) +e1000_up (adapter); err_setup:clear_bit (__E1000_RESETTING, &adapter->flags);return err;
drivers/net/ethernet/realtek/r8169.c +6 -3
@@ -759,7 +759,7 @@ struct rtl8169_tc_offsets { };enum rtl_flag { -RTL_FLAG_TASK_ENABLED , +RTL_FLAG_TASK_ENABLED =0 ,RTL_FLAG_TASK_SLOW_PENDING ,RTL_FLAG_TASK_RESET_PENDING ,RTL_FLAG_TASK_PHY_PENDING ,
@@ -7618,7 +7618,8 @@ static int rtl8169_close(struct net_device *dev)rtl8169_update_counters (dev);rtl_lock_work (tp); -clear_bit (RTL_FLAG_TASK_ENABLED , tp->wk.flags); +/* Clear all task flags */ +bitmap_zero (tp->wk.flags,RTL_FLAG_MAX );rtl8169_down (dev);rtl_unlock_work (tp);
@@ -7795,7 +7796,9 @@ static void rtl8169_net_suspend(struct net_device *dev)rtl_lock_work (tp);napi_disable (&tp->napi); -clear_bit (RTL_FLAG_TASK_ENABLED , tp->wk.flags); +/* Clear all task flags */ +bitmap_zero (tp->wk.flags,RTL_FLAG_MAX ); +rtl_unlock_work (tp);rtl_pll_power_down (tp);
drivers/net/wireless/ath/ath10k/htt_rx.c +4 -1
@@ -212,11 +212,12 @@ int ath10k_htt_rx_ring_refill(struct ath10k *ar)spin_lock_bh (&htt->rx_ring.lock); ret =ath10k_htt_rx_ring_fill_n (htt, (htt->rx_ring.fill_level - htt->rx_ring.fill_cnt)); -spin_unlock_bh (&htt->rx_ring.lock);if (ret)ath10k_htt_rx_ring_free (htt); +spin_unlock_bh (&htt->rx_ring.lock); +return ret; }
@@ -230,7 +231,9 @@ void ath10k_htt_rx_free(struct ath10k_htt *htt)skb_queue_purge (&htt->rx_compl_q);skb_queue_purge (&htt->rx_in_ord_compl_q); +spin_lock_bh (&htt->rx_ring.lock);ath10k_htt_rx_ring_free (htt); +spin_unlock_bh (&htt->rx_ring.lock); dma_free_coherent(htt->ar->dev, (htt->rx_ring.size *
drivers/net/wireless/mac80211_hwsim.c +0 -3
@@ -2453,9 +2453,6 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,IEEE80211_VHT_CAP_SHORT_GI_80 |IEEE80211_VHT_CAP_SHORT_GI_160 |IEEE80211_VHT_CAP_TXSTBC | -IEEE80211_VHT_CAP_RXSTBC_1 | -IEEE80211_VHT_CAP_RXSTBC_2 | -IEEE80211_VHT_CAP_RXSTBC_3 |IEEE80211_VHT_CAP_RXSTBC_4 |IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK ; sband->vht_cap.vht_mcs.rx_mcs_map =
drivers/net/wireless/rndis_wlan.c +2 -0
@@ -2919,6 +2919,8 @@ static void rndis_wlan_auth_indication(struct usbnet *usbdev,while (buflen >=sizeof (*auth_req)) { auth_req = (void *)buf; +if (buflen <le32_to_cpu (auth_req->length)) +return ; type ="unknown" ; flags =le32_to_cpu (auth_req->flags); pairwise_error = false;
drivers/net/wireless/ti/wlcore/cmd.c +6 -0
@@ -35,6 +35,7 @@#include "wl12xx_80211.h" #include "cmd.h" #include "event.h" +#include "ps.h" #include "tx.h" #include "hw_ops.h"
@@ -191,6 +192,10 @@ 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",
@@ -222,6 +227,7 @@ 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/power/reset/vexpress-poweroff.c +8 -4
@@ -35,6 +35,7 @@ static void vexpress_reset_do(struct device *dev, const char *what) }static struct device *vexpress_power_off_device; +static atomic_t vexpress_restart_nb_refcnt =ATOMIC_INIT (0 );static void vexpress_power_off (void ) {
@@ -99,10 +100,13 @@ static int _vexpress_register_restart_handler(struct device *dev)int err; vexpress_restart_device = dev; - err =register_restart_handler (&vexpress_restart_nb); -if (err) { -dev_err (dev,"cannot register restart handler (err=%d)\n" , err); -return err; +if (atomic_inc_return (&vexpress_restart_nb_refcnt) ==1 ) { + err =register_restart_handler (&vexpress_restart_nb); +if (err) { +dev_err (dev,"cannot register restart handler (err=%d)\n" , err); +atomic_dec (&vexpress_restart_nb_refcnt); +return err; + } }device_create_file (dev, &dev_attr_active);
drivers/s390/net/qeth_l2_main.c +1 -1
@@ -523,7 +523,7 @@ static int qeth_l2_process_inbound_buffer(struct qeth_card *card,default :dev_kfree_skb_any (skb);QETH_CARD_TEXT (card,3 ,"inbunkno" ); -QETH_DBF_HEX (CTRL ,3 , hdr,QETH_DBF_CTRL_LEN ); +QETH_DBF_HEX (CTRL ,3 , hdr,sizeof (*hdr));continue ; } work_done++;
drivers/s390/net/qeth_l3_main.c +1 -1
@@ -1902,7 +1902,7 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card,default :dev_kfree_skb_any (skb);QETH_CARD_TEXT (card,3 ,"inbunkno" ); -QETH_DBF_HEX (CTRL ,3 , hdr,QETH_DBF_CTRL_LEN ); +QETH_DBF_HEX (CTRL ,3 , hdr,sizeof (*hdr));continue ; } work_done++;
drivers/scsi/bnx2i/bnx2i_hwi.c +2 -0
@@ -2742,6 +2742,8 @@ int bnx2i_map_ep_dbell_regs(struct bnx2i_endpoint *ep) BNX2X_DOORBELL_PCI_BAR); reg_off = (1 <<BNX2X_DB_SHIFT ) * (cid_num &0x1FFFF ); ep->qp.ctx_base =ioremap_nocache (reg_base + reg_off,4 ); +if (!ep->qp.ctx_base) +return -ENOMEM ; goto arm_cq; }
drivers/scsi/ibmvscsi/ibmvscsi.c +2 -2
@@ -93,7 +93,7 @@ static int max_requests = IBMVSCSI_MAX_REQUESTS_DEFAULT;static int max_events =IBMVSCSI_MAX_REQUESTS_DEFAULT +2 ;static int fast_fail =1 ;static int client_reserve =1 ; -static char partition_name[97 ] ="UNKNOWN" ; +static char partition_name[96 ] ="UNKNOWN" ;static unsigned int partition_number =-1 ;static struct scsi_transport_template *ibmvscsi_transport_template;
@@ -261,7 +261,7 @@ static void gather_partition_info(void) ppartition_name =of_get_property (rootdn,"ibm,partition-name" ,NULL );if (ppartition_name) -strncpy (partition_name, ppartition_name, +strlcpy (partition_name, ppartition_name,sizeof (partition_name)); p_number_ptr =of_get_property (rootdn,"ibm,partition-no" ,NULL );if (p_number_ptr)
drivers/spi/spi-rspi.c +30 -4
@@ -587,11 +587,13 @@ static int rspi_dma_transfer(struct rspi_data *rspi, struct sg_table *tx, ret =wait_event_interruptible_timeout (rspi->wait, rspi->dma_callbacked,HZ ); -if (ret >0 && rspi->dma_callbacked) +if (ret >0 && rspi->dma_callbacked) { ret =0 ; -else if (!ret) { -dev_err (&rspi->master->dev,"DMA timeout\n" ); - ret = -ETIMEDOUT ; + }else { +if (!ret) { +dev_err (&rspi->master->dev,"DMA timeout\n" ); + ret = -ETIMEDOUT ; + }if (tx)dmaengine_terminate_all (rspi->master->dma_tx);if (rx)
@@ -1303,12 +1305,36 @@ static const struct platform_device_id spi_driver_ids[] = {MODULE_DEVICE_TABLE (platform, spi_driver_ids); +#ifdef CONFIG_PM_SLEEP +static int rspi_suspend (struct device *dev) +{ +struct platform_device *pdev =to_platform_device (dev); +struct rspi_data *rspi =platform_get_drvdata (pdev); + +return spi_master_suspend (rspi->master); +} + +static int rspi_resume (struct device *dev) +{ +struct platform_device *pdev =to_platform_device (dev); +struct rspi_data *rspi =platform_get_drvdata (pdev); + +return spi_master_resume (rspi->master); +} + +static SIMPLE_DEV_PM_OPS(rspi_pm_ops, rspi_suspend, rspi_resume); +#define DEV_PM_OPS &rspi_pm_ops +#else +#define DEV_PM_OPS NULL +#endif /* CONFIG_PM_SLEEP */ +static struct platform_driver rspi_driver = { .probe = rspi_probe, .remove = rspi_remove, .id_table = spi_driver_ids, .driver = { .name ="renesas_spi" , + .pm =DEV_PM_OPS , .of_match_table =of_match_ptr (rspi_of_match), }, };
drivers/spi/spi-sh-msiof.c +27 -1
@@ -374,7 +374,8 @@ static void sh_msiof_spi_set_mode_regs(struct sh_msiof_spi_priv *p,static void sh_msiof_reset_str (struct sh_msiof_spi_priv *p) { -sh_msiof_write (p,STR ,sh_msiof_read (p,STR )); +sh_msiof_write (p,STR , +sh_msiof_read (p,STR ) & ~(STR_TDREQ |STR_RDREQ )); } static void sh_msiof_spi_write_fifo_8(struct sh_msiof_spi_priv *p,
@@ -1275,12 +1276,37 @@ static const struct platform_device_id spi_driver_ids[] = { };MODULE_DEVICE_TABLE (platform, spi_driver_ids); +#ifdef CONFIG_PM_SLEEP +static int sh_msiof_spi_suspend (struct device *dev) +{ +struct platform_device *pdev =to_platform_device (dev); +struct sh_msiof_spi_priv *p =platform_get_drvdata (pdev); + +return spi_master_suspend (p->master); +} + +static int sh_msiof_spi_resume (struct device *dev) +{ +struct platform_device *pdev =to_platform_device (dev); +struct sh_msiof_spi_priv *p =platform_get_drvdata (pdev); + +return spi_master_resume (p->master); +} + +static SIMPLE_DEV_PM_OPS(sh_msiof_spi_pm_ops, sh_msiof_spi_suspend, + sh_msiof_spi_resume); +#define DEV_PM_OPS &sh_msiof_spi_pm_ops +#else +#define DEV_PM_OPS NULL +#endif /* CONFIG_PM_SLEEP */ +static struct platform_driver sh_msiof_spi_drv = { .probe = sh_msiof_spi_probe, .remove = sh_msiof_spi_remove, .id_table = spi_driver_ids, .driver = { .name ="spi_sh_msiof" , + .pm =DEV_PM_OPS , .of_match_table =of_match_ptr (sh_msiof_match), }, };
drivers/spi/spi-tegra20-slink.c +23 -8
@@ -1063,6 +1063,24 @@ static int tegra_slink_probe(struct platform_device *pdev) goto exit_free_master; } +/* disabled clock may cause interrupt storm upon request */ + tspi->clk =devm_clk_get (&pdev->dev,NULL ); +if (IS_ERR (tspi->clk)) { + ret =PTR_ERR (tspi->clk); +dev_err (&pdev->dev,"Can not get clock %d\n" , ret); + goto exit_free_master; + } + ret =clk_prepare (tspi->clk); +if (ret <0 ) { +dev_err (&pdev->dev,"Clock prepare failed %d\n" , ret); + goto exit_free_master; + } + ret =clk_enable (tspi->clk); +if (ret <0 ) { +dev_err (&pdev->dev,"Clock enable failed %d\n" , ret); + goto exit_free_master; + } + spi_irq =platform_get_irq (pdev,0 ); tspi->irq = spi_irq; ret = request_threaded_irq(tspi->irq, tegra_slink_isr,
@@ -1071,14 +1089,7 @@ static int tegra_slink_probe(struct platform_device *pdev)if (ret <0 ) {dev_err (&pdev->dev,"Failed to register ISR for IRQ %d\n" , tspi->irq); - goto exit_free_master; - } - - tspi->clk =devm_clk_get (&pdev->dev,NULL ); -if (IS_ERR (tspi->clk)) { -dev_err (&pdev->dev,"can not get clock\n" ); - ret =PTR_ERR (tspi->clk); - goto exit_free_irq; + goto exit_clk_disable; } tspi->rst =devm_reset_control_get (&pdev->dev,"spi" );
@@ -1138,6 +1149,8 @@ exit_rx_dma_free:tegra_slink_deinit_dma_param (tspi, true); exit_free_irq:free_irq (spi_irq, tspi); +exit_clk_disable: +clk_disable (tspi->clk); exit_free_master:spi_master_put (master);return ret;
@@ -1150,6 +1163,8 @@ static int tegra_slink_remove(struct platform_device *pdev)free_irq (tspi->irq, tspi); +clk_disable (tspi->clk); +if (tspi->tx_dma_chan)tegra_slink_deinit_dma_param (tspi, false);
drivers/staging/android/ashmem.c +6 -0
@@ -370,6 +370,12 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma) goto out; } +/* requested mapping size larger than object size */ +if (vma->vm_end - vma->vm_start >PAGE_ALIGN (asma->size)) { + ret = -EINVAL ; + goto out; + } +/* requested protection bits must match our allowed protection mask */ if (unlikely ((vma->vm_flags & ~calc_vm_prot_bits (asma->prot_mask)) &calc_vm_prot_bits (PROT_MASK ))) {
drivers/staging/rts5208/sd.c +1 -1
@@ -5031,7 +5031,7 @@ int sd_execute_write_data(struct scsi_cmnd *srb, struct rtsx_chip *chip) goto SD_Execute_Write_Cmd_Failed; } -rtsx_write_register (chip,SD_BYTE_CNT_L ,0xFF ,0x00 ); + retval =rtsx_write_register (chip,SD_BYTE_CNT_L ,0xFF ,0x00 );if (retval !=STATUS_SUCCESS ) {rtsx_trace (chip); goto SD_Execute_Write_Cmd_Failed;
drivers/target/iscsi/iscsi_target_auth.c +3 -12
@@ -26,15 +26,6 @@#include "iscsi_target_nego.h" #include "iscsi_target_auth.h" -static void chap_binaryhex_to_asciihex (char *dst,char *src,int src_len) -{ -int i; - -for (i =0 ; i < src_len; i++) { -sprintf (&dst[i*2 ],"%02x" , (int ) src[i] &0xff ); - } -} - static void chap_gen_challenge( struct iscsi_conn *conn, int caller,
@@ -47,7 +38,7 @@ static void chap_gen_challenge(memset (challenge_asciihex,0 ,CHAP_CHALLENGE_LENGTH *2 +1 );get_random_bytes (chap->challenge,CHAP_CHALLENGE_LENGTH ); -chap_binaryhex_to_asciihex (challenge_asciihex, chap->challenge, +bin2hex (challenge_asciihex, chap->challenge,CHAP_CHALLENGE_LENGTH );/* * Set CHAP_C, and copy the generated challenge into c_str.
@@ -287,7 +278,7 @@ static int chap_server_compute_md5( }crypto_free_hash (tfm); -chap_binaryhex_to_asciihex (response, server_digest,MD5_SIGNATURE_SIZE ); +bin2hex (response, server_digest,MD5_SIGNATURE_SIZE );pr_debug ("[server] MD5 Server Digest: %s\n" , response);if (memcmp (server_digest, client_digest,MD5_SIGNATURE_SIZE ) !=0 ) {
@@ -431,7 +422,7 @@ static int chap_server_compute_md5(/* * Convert response from binary hex to ascii hext. */ -chap_binaryhex_to_asciihex (response, digest,MD5_SIGNATURE_SIZE ); +bin2hex (response, digest,MD5_SIGNATURE_SIZE ); *nr_out_len +=sprintf (nr_out_ptr + *nr_out_len,"CHAP_R=0x%s" , response); *nr_out_len +=1 ;
drivers/target/iscsi/iscsi_target_tpg.c +1 -2
@@ -637,8 +637,7 @@ int iscsit_ta_authentication(struct iscsi_portal_group *tpg, u32 authentication) none =strstr (buf1,NONE );if (none) goto out; -strncat (buf1,"," ,strlen ("," )); -strncat (buf1,NONE ,strlen (NONE )); +strlcat (buf1,"," NONE ,sizeof (buf1));if (iscsi_update_param_value (param, buf1) <0 )return -EINVAL ; }
drivers/thermal/of-thermal.c +5 -2
@@ -284,10 +284,13 @@ static int of_thermal_set_mode(struct thermal_zone_device *tz,mutex_lock (&tz->lock); -if (mode ==THERMAL_DEVICE_ENABLED ) +if (mode ==THERMAL_DEVICE_ENABLED ) { tz->polling_delay = data->polling_delay; -else + tz->passive_delay = data->passive_delay; + }else { tz->polling_delay =0 ; + tz->passive_delay =0 ; + }mutex_unlock (&tz->lock);
drivers/tty/serial/8250/serial_cs.c +4 -2
@@ -629,8 +629,10 @@ static int serial_config(struct pcmcia_device * link) (link->has_func_id) && (link->socket->pcmcia_pfc ==0 ) && ((link->func_id ==CISTPL_FUNCID_MULTI ) || - (link->func_id == CISTPL_FUNCID_SERIAL))) -pcmcia_loop_config (link, serial_check_for_multi, info); + (link->func_id == CISTPL_FUNCID_SERIAL))) { + if (pcmcia_loop_config(link, serial_check_for_multi, info)) + goto failed; + }/* * Apply any multi-port quirk.
drivers/tty/serial/cpm_uart/cpm_uart_core.c +7 -3
@@ -1068,8 +1068,8 @@ static int poll_wait_key(char *obuf, struct uart_cpm_port *pinfo)/* Get the address of the host memory buffer. */ bdp = pinfo->rx_cur; -while (bdp->cbd_sc &BD_SC_EMPTY ) - ; +if (bdp->cbd_sc &BD_SC_EMPTY ) +return NO_POLL_CHAR ;/* If the buffer address is in the CPM DPRAM, don't * convert it.
@@ -1104,7 +1104,11 @@ static int cpm_get_poll_char(struct uart_port *port) poll_chars =0 ; }if (poll_chars <=0 ) { - poll_chars =poll_wait_key (poll_buf, pinfo); +int ret =poll_wait_key (poll_buf, pinfo); + +if (ret ==NO_POLL_CHAR ) +return ret; + poll_chars = ret; pollp = poll_buf; } poll_chars--;
drivers/tty/serial/imx.c +8 -0
@@ -1997,6 +1997,14 @@ static int serial_imx_probe(struct platform_device *pdev) dev_name(&pdev->dev), sport);if (ret)return ret; + + ret =devm_request_irq (&pdev->dev, rtsirq, imx_rtsint,0 , +dev_name (&pdev->dev), sport); +if (ret) { +dev_err (&pdev->dev,"failed to request rts irq: %d\n" , + ret); +return ret; + } }else { ret =devm_request_irq (&pdev->dev, rxirq, imx_int,0 ,dev_name (&pdev->dev), sport);
drivers/usb/class/cdc-wdm.c +1 -1
@@ -453,7 +453,7 @@ static int clear_wdm_read_flag(struct wdm_device *desc)set_bit (WDM_RESPONDING , &desc->flags);spin_unlock_irq (&desc->iuspin); - rv =usb_submit_urb (desc->response,GFP_ATOMIC ); + rv =usb_submit_urb (desc->response,GFP_KERNEL );spin_lock_irq (&desc->iuspin);if (rv) { dev_err(&desc->intf->dev,
drivers/usb/core/devio.c +21 -3
@@ -1289,10 +1289,13 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurbstruct async *as =NULL ;struct usb_ctrlrequest *dr =NULL ;unsigned int u, totlen, isofrmlen; -int i, ret, is_in, num_sgs =0 , ifnum =-1 ; +int i, ret, num_sgs =0 , ifnum =-1 ;int number_of_packets =0 ;unsigned int stream_id =0 ;void *buf; +bool is_in; +bool allow_short = false; +bool allow_zero = false;unsigned long mask =USBDEVFS_URB_SHORT_NOT_OK |USBDEVFS_URB_BULK_CONTINUATION | USBDEVFS_URB_NO_FSBR |
@@ -1326,6 +1329,8 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb u =0 ;switch (uurb->type) {case USBDEVFS_URB_TYPE_CONTROL : +if (is_in) + allow_short = true;if (!usb_endpoint_xfer_control (&ep->desc))return -EINVAL ;/* min 8 byte setup packet */
@@ -1366,6 +1371,10 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurbbreak ;case USBDEVFS_URB_TYPE_BULK : +if (!is_in) + allow_zero = true; +else + allow_short = true;switch (usb_endpoint_type (&ep->desc)) {case USB_ENDPOINT_XFER_CONTROL :case USB_ENDPOINT_XFER_ISOC :
@@ -1386,6 +1395,10 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurbif (!usb_endpoint_xfer_int (&ep->desc))return -EINVAL ; interrupt_urb: +if (!is_in) + allow_zero = true; +else + allow_short = true;break ;case USBDEVFS_URB_TYPE_ISO :
@@ -1512,16 +1525,21 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb u = (is_in ?URB_DIR_IN :URB_DIR_OUT );if (uurb->flags &USBDEVFS_URB_ISO_ASAP ) u |=URB_ISO_ASAP ; -if (uurb->flags &USBDEVFS_URB_SHORT_NOT_OK && is_in) +if (allow_short && uurb->flags &USBDEVFS_URB_SHORT_NOT_OK ) u |=URB_SHORT_NOT_OK ;if (uurb->flags &USBDEVFS_URB_NO_FSBR ) u |=URB_NO_FSBR ; -if (uurb->flags &USBDEVFS_URB_ZERO_PACKET ) +if (allow_zero && uurb->flags &USBDEVFS_URB_ZERO_PACKET ) u |=URB_ZERO_PACKET ;if (uurb->flags &USBDEVFS_URB_NO_INTERRUPT ) u |=URB_NO_INTERRUPT ; as->urb->transfer_flags = u; +if (!allow_short && uurb->flags &USBDEVFS_URB_SHORT_NOT_OK ) +dev_warn (&ps->dev->dev,"Requested nonsensical USBDEVFS_URB_SHORT_NOT_OK.\n" ); +if (!allow_zero && uurb->flags &USBDEVFS_URB_ZERO_PACKET ) +dev_warn (&ps->dev->dev,"Requested nonsensical USBDEVFS_URB_ZERO_PACKET.\n" ); + as->urb->transfer_buffer_length = uurb->buffer_length; as->urb->setup_packet = (unsigned char *)dr; dr =NULL ;
drivers/usb/core/driver.c +14 -14
@@ -509,7 +509,6 @@ int usb_driver_claim_interface(struct usb_driver *driver,struct device *dev;struct usb_device *udev;int retval =0 ; -int lpm_disable_error = -ENODEV ;if (!iface)return -ENODEV ;
@@ -530,16 +529,6 @@ int usb_driver_claim_interface(struct usb_driver *driver, iface->condition =USB_INTERFACE_BOUND ; -/* See the comment about disabling LPM in usb_probe_interface(). */ -if (driver->disable_hub_initiated_lpm) { - lpm_disable_error =usb_unlocked_disable_lpm (udev); -if (lpm_disable_error) { -dev_err (&iface->dev,"%s Failed to disable LPM for driver %s\n." , - __func__, driver->name); -return -ENOMEM ; - } - } -/* Claimed interfaces are initially inactive (suspended) and * runtime-PM-enabled, but only if the driver has autosuspend * support. Otherwise they are marked active, to prevent the
@@ -558,9 +547,20 @@ int usb_driver_claim_interface(struct usb_driver *driver,if (device_is_registered (dev)) retval =device_bind_driver (dev); -/* Attempt to re-enable USB3 LPM, if the disable was successful. */ -if (!lpm_disable_error) -usb_unlocked_enable_lpm (udev); +if (retval) { + dev->driver =NULL ; +usb_set_intfdata (iface,NULL ); + iface->needs_remote_wakeup =0 ; + iface->condition =USB_INTERFACE_UNBOUND ; + +/* +* Unbound interfaces are always runtime-PM-disabled +* and runtime-PM-suspended +*/ +if (driver->supports_autosuspend) +pm_runtime_disable (dev); +pm_runtime_set_suspended (dev); + }return retval; }
drivers/usb/core/usb.c +2 -0
@@ -95,6 +95,8 @@ struct usb_host_interface *usb_find_alt_setting(struct usb_interface_cache *intf_cache =NULL ;int i; +if (!config) +return NULL ;for (i =0 ; i < config->desc.bNumInterfaces; i++) {if (config->intf_cache[i]->altsetting[0 ].desc.bInterfaceNumber == iface_num) {
drivers/usb/gadget/udc/fotg210-udc.c +10 -5
@@ -1066,12 +1066,15 @@ static struct usb_gadget_ops fotg210_gadget_ops = {static int fotg210_udc_remove (struct platform_device *pdev) {struct fotg210_udc *fotg210 =platform_get_drvdata (pdev); +int i;usb_del_gadget_udc (&fotg210->gadget);iounmap (fotg210->reg);free_irq (platform_get_irq (pdev,0 ), fotg210);fotg210_ep_free_request (&fotg210->ep[0 ]->ep, fotg210->ep0_req); +for (i =0 ; i <FOTG210_MAX_NUM_EP ; i++) +kfree (fotg210->ep[i]);kfree (fotg210);return 0 ;
@@ -1102,7 +1105,7 @@ static int fotg210_udc_probe(struct platform_device *pdev)/* initialize udc */ fotg210 =kzalloc (sizeof (struct fotg210_udc ),GFP_KERNEL );if (fotg210 ==NULL ) - goto err_alloc; + goto err;for (i =0 ; i <FOTG210_MAX_NUM_EP ; i++) { _ep[i] =kzalloc (sizeof (struct fotg210_ep ),GFP_KERNEL );
@@ -1114,7 +1117,7 @@ static int fotg210_udc_probe(struct platform_device *pdev) fotg210->reg =ioremap (res->start,resource_size (res));if (fotg210->reg ==NULL ) {pr_err ("ioremap error.\n" ); - goto err_map; + goto err_alloc; }spin_lock_init (&fotg210->lock);
@@ -1162,7 +1165,7 @@ static int fotg210_udc_probe(struct platform_device *pdev) fotg210->ep0_req =fotg210_ep_alloc_request (&fotg210->ep[0 ]->ep,GFP_KERNEL );if (fotg210->ep0_req ==NULL ) - goto err_req; + goto err_map;fotg210_init (fotg210);
@@ -1190,12 +1193,14 @@ err_req:fotg210_ep_free_request (&fotg210->ep[0 ]->ep, fotg210->ep0_req); err_map: -if (fotg210->reg) -iounmap (fotg210->reg); +iounmap (fotg210->reg); err_alloc: +for (i =0 ; i <FOTG210_MAX_NUM_EP ; i++) +kfree (fotg210->ep[i]);kfree (fotg210); +err:return ret; }
drivers/usb/misc/yurex.c +3 -0
@@ -431,6 +431,9 @@ static ssize_t yurex_read(struct file *file, char __user *buffer, size_t count,spin_unlock_irqrestore (&dev->lock, flags);mutex_unlock (&dev->io_mutex); +if (WARN_ON_ONCE (len >=sizeof (in_buffer))) +return -EIO ; +return simple_read_from_buffer (buffer, count, ppos, in_buffer, len); }
drivers/usb/serial/kobil_sct.c +10 -2
@@ -408,12 +408,20 @@ static int kobil_tiocmget(struct tty_struct *tty) transfer_buffer_length, KOBIL_TIMEOUT); -dev_dbg (&port->dev,"%s - Send get_status_line_state URB returns: %i. Statusline: %02x\n" , - __func__, result, transfer_buffer[0 ]); +dev_dbg (&port->dev,"Send get_status_line_state URB returns: %i\n" , + result); +if (result <1 ) { +if (result >=0 ) + result = -EIO ; + goto out_free; + } + +dev_dbg (&port->dev,"Statusline: %02x\n" , transfer_buffer[0 ]); result =0 ;if ((transfer_buffer[0 ] &SUSBCR_GSL_DSR ) !=0 ) result =TIOCM_DSR ; +out_free:kfree (transfer_buffer);return result; }
drivers/usb/wusbcore/security.c +1 -1
@@ -230,7 +230,7 @@ int wusb_dev_sec_add(struct wusbhc *wusbhc, result =usb_get_descriptor (usb_dev,USB_DT_SECURITY ,0 , secd,sizeof (*secd)); -if (result <sizeof (*secd)) { +if (result < (int )sizeof (*secd)) {dev_err (dev,"Can't read security descriptor or " "not enough data: %d\n" , result); goto out;
drivers/uwb/hwa-rc.c +1 -0
@@ -875,6 +875,7 @@ error_get_version: error_rc_add:usb_put_intf (iface);usb_put_dev (hwarc->usb_dev); +kfree (hwarc); error_alloc:uwb_rc_put (uwb_rc); error_rc_alloc:
drivers/xen/cpu_hotplug.c +8 -7
@@ -18,15 +18,16 @@ static void enable_hotplug_cpu(int cpu)static void disable_hotplug_cpu (int cpu) { -if (cpu_online (cpu)) { -lock_device_hotplug (); +if (!cpu_is_hotpluggable (cpu)) +return ; +lock_device_hotplug (); +if (cpu_online (cpu))device_offline (get_cpu_device (cpu)); -unlock_device_hotplug (); - } -if (cpu_present (cpu)) +if (!cpu_online (cpu) &&cpu_present (cpu)) {xen_arch_unregister_cpu (cpu); - -set_cpu_present (cpu, false); +set_cpu_present (cpu, false); + } +unlock_device_hotplug (); }static int vcpu_online (unsigned int cpu)
drivers/xen/events/events_base.c +1 -1
@@ -139,7 +139,7 @@ static int set_evtchn_to_irq(unsigned evtchn, unsigned irq)clear_evtchn_to_irq_row (row); } - evtchn_to_irq[EVTCHN_ROW (evtchn)][EVTCHN_COL (evtchn)] = irq; + evtchn_to_irq[row][col] = irq;return 0 ; }
drivers/xen/manage.c +4 -2
@@ -280,9 +280,11 @@ static void sysrq_handler(struct xenbus_watch *watch, const char **vec,/* * The Xenstore watch fires directly after registering it and * after a suspend/resume cycle. So ENOENT is no error but -* might happen in those cases. +* might happen in those cases. ERANGE is observed when we get +* an empty value (''), this happens when we acknowledge the +* request by writing '\0' below. */ -if (err != -ENOENT ) +if (err != -ENOENT && err != -ERANGE )pr_err ("Error %d reading sysrq code in control/sysrq\n" , err);xenbus_transaction_end (xbt,1 );
fs/cifs/cifs_unicode.c +0 -3
@@ -101,9 +101,6 @@ convert_sfm_char(const __u16 src_char, char *target)case SFM_LESSTHAN : *target ='<' ;break ; -case SFM_SLASH : - *target ='\\' ; -break ;case SFM_SPACE : *target =' ' ;break ;
fs/cifs/cifssmb.c +8 -3
@@ -577,10 +577,15 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses) } count =0 ; +/* +* We know that all the name entries in the protocols array +* are short (< 16 bytes anyway) and are NUL terminated. +*/ for (i =0 ; i <CIFS_NUM_PROT ; i++) { -strncpy (pSMB->DialectsArray+count, protocols[i].name,16 ); - count +=strlen (protocols[i].name) +1 ; -/* null at end of source and target buffers anyway */ +size_t len =strlen (protocols[i].name) +1 ; + +memcpy (pSMB->DialectsArray+count, protocols[i].name, len); + count += len; }inc_rfc1001_len (pSMB, count); pSMB->ByteCount =cpu_to_le16 (count);
fs/cifs/misc.c +8 -0
@@ -406,9 +406,17 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv) (struct smb_com_transaction_change_notify_rsp *)buf;struct file_notify_information *pnotify;__u32 data_offset =0 ; +size_t len = srv->total_read -sizeof (pSMBr->hdr.smb_buf_length); +if (get_bcc (buf) >sizeof (struct file_notify_information )) { data_offset =le32_to_cpu (pSMBr->DataOffset); +if (data_offset > + len -sizeof (struct file_notify_information )) { +cifs_dbg (FYI ,"invalid data_offset %u\n" , + data_offset); +return true; + } pnotify = (struct file_notify_information *) ((char *)&pSMBr->hdr.Protocol + data_offset); cifs_dbg(FYI, "dnotify on %s Action: 0x%x\n",
fs/cifs/smb2ops.c +1 -1
@@ -914,7 +914,7 @@ smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon, } srch_inf->entries_in_buffer =0 ; - srch_inf->index_of_last_entry =0 ; + srch_inf->index_of_last_entry =2 ; rc =SMB2_query_directory (xid, tcon, fid->persistent_fid, fid->volatile_fid,0 , srch_inf);
fs/ext4/xattr.c +5 -0
@@ -1386,6 +1386,11 @@ retry:/* Find the entry best suited to be pushed into EA block */ entry =NULL ;for (; !IS_LAST_ENTRY (last); last =EXT4_XATTR_NEXT (last)) { +/* never move system.data out of the inode */ +if ((last->e_name_len ==4 ) && + (last->e_name_index ==EXT4_XATTR_INDEX_SYSTEM ) && + !memcmp (last->e_name,"data" ,4 )) +continue ; total_size =EXT4_XATTR_SIZE (le32_to_cpu (last->e_value_size)) +EXT4_XATTR_LEN (last->e_name_len);
fs/nfsd/nfs4proc.c +1 -0
@@ -1632,6 +1632,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,if (status) { op = &args->ops[0 ]; op->status = status; + resp->opcnt =1 ; goto encode_op; }
fs/ocfs2/dlm/dlmmaster.c +2 -2
@@ -589,9 +589,9 @@ static void dlm_init_lockres(struct dlm_ctxt *dlm, res->last_used =0 ; -spin_lock (&dlm->spinlock); +spin_lock (&dlm->track_lock);list_add_tail (&res->tracking, &dlm->tracking_list); -spin_unlock (&dlm->spinlock); +spin_unlock (&dlm->track_lock);memset (res->lvb,0 ,DLM_LVB_LEN );memset (res->refmap,0 ,sizeof (res->refmap));
fs/proc/base.c +14 -0
@@ -471,6 +471,20 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns,int err;int i; +/* +* The ability to racily run the kernel stack unwinder on a running task +* and then observe the unwinder output is scary; while it is useful for +* debugging kernel issues, it can also allow an attacker to leak kernel +* stack contents. +* Doing this in a manner that is at least safe from races would require +* some work to ensure that the remote task can not be scheduled; and +* even then, this would still expose the unwinder as local attack +* surface. +* Therefore, this interface is restricted to root. +*/ +if (!file_ns_capable (m->file, &init_user_ns,CAP_SYS_ADMIN )) +return -EACCES ; + entries =kmalloc (MAX_STACK_TRACE_DEPTH *sizeof (*entries),GFP_KERNEL );if (!entries)return -ENOMEM ;
include/linux/platform_data/ina2xx.h +1 -1
@@ -1,7 +1,7 @@/* * Driver for Texas Instruments INA219, INA226 power monitor chips * -* Copyright (C) 2012 Lothar Felten <[email protected]> +* Copyright (C) 2012 Lothar Felten <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as
include/linux/slub_def.h +2 -1
@@ -67,7 +67,8 @@ struct kmem_cache {int size;/* The size of an object including meta data */ int object_size;/* The size of an object without meta data */ int offset;/* Free pointer offset. */ -int cpu_partial;/* Number of per cpu partial objects to keep around */ +/* Number of per cpu partial objects to keep around */ +unsigned int cpu_partial;struct kmem_cache_order_objects oo;/* Allocation and freeing of slabs */
include/media/v4l2-fh.h +1 -0
@@ -43,6 +43,7 @@ struct v4l2_fh {wait_queue_head_t wait;struct list_head subscribed;/* Subscribed events */ struct list_head available;/* Dequeueable event */ +struct mutex subscribe_lock;unsigned int navailable;u32 sequence;
kernel/module.c +5 -1
@@ -3860,7 +3860,7 @@ static unsigned long mod_find_symname(struct module *mod, const char *name)for (i =0 ; i < kallsyms->num_symtab; i++)if (strcmp (name,symname (kallsyms, i)) ==0 && - kallsyms->symtab[i].st_info !='U' ) + kallsyms->symtab[i].st_shndx !=SHN_UNDEF )return kallsyms->symtab[i].st_value;return 0 ; }
@@ -3906,6 +3906,10 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,if (mod->state ==MODULE_STATE_UNFORMED )continue ;for (i =0 ; i < kallsyms->num_symtab; i++) { + +if (kallsyms->symtab[i].st_shndx ==SHN_UNDEF ) +continue ; + ret =fn (data,symname (kallsyms, i), mod, kallsyms->symtab[i].st_value);if (ret !=0 )
kernel/time/alarmtimer.c +2 -1
@@ -773,7 +773,8 @@ static int alarm_timer_nsleep(const clockid_t which_clock, int flags,/* Convert (if necessary) to absolute time */ if (flags !=TIMER_ABSTIME ) {ktime_t now = alarm_bases[type].gettime (); - exp =ktime_add (now, exp); + + exp =ktime_add_safe (now, exp); }if (alarmtimer_do_nsleep (&alarm, exp))
lib/klist.c +6 -4
@@ -336,8 +336,9 @@ struct klist_node *klist_prev(struct klist_iter *i)void (*put)(struct klist_node *) = i->i_klist->put;struct klist_node *last = i->i_cur;struct klist_node *prev; +unsigned long flags; -spin_lock (&i->i_klist->k_lock); +spin_lock_irqsave (&i->i_klist->k_lock, flags);if (last) { prev =to_klist_node (last->n_node.prev);
@@ -356,7 +357,7 @@ struct klist_node *klist_prev(struct klist_iter *i) prev =to_klist_node (prev->n_node.prev); } -spin_unlock (&i->i_klist->k_lock); +spin_unlock_irqrestore (&i->i_klist->k_lock, flags);if (put && last)put (last);
@@ -377,8 +378,9 @@ struct klist_node *klist_next(struct klist_iter *i)void (*put)(struct klist_node *) = i->i_klist->put;struct klist_node *last = i->i_cur;struct klist_node *next; +unsigned long flags; -spin_lock (&i->i_klist->k_lock); +spin_lock_irqsave (&i->i_klist->k_lock, flags);if (last) { next =to_klist_node (last->n_node.next);
@@ -397,7 +399,7 @@ struct klist_node *klist_next(struct klist_iter *i) next =to_klist_node (next->n_node.next); } -spin_unlock (&i->i_klist->k_lock); +spin_unlock_irqrestore (&i->i_klist->k_lock, flags);if (put && last)put (last);
mm/madvise.c +1 -1
@@ -76,7 +76,7 @@ static long madvise_behavior(struct vm_area_struct *vma, new_flags |=VM_DONTDUMP ;break ;case MADV_DODUMP : -if (new_flags &VM_SPECIAL ) { +if (!is_vm_hugetlb_page (vma) && new_flags &VM_SPECIAL ) { error = -EINVAL ; goto out; }
mm/slub.c +3 -3
@@ -1661,7 +1661,7 @@ static void *get_partial_node(struct kmem_cache *s, struct kmem_cache_node *n, {struct page *page, *page2;void *object =NULL ; -int available =0 ; +unsigned int available =0 ;int objects;/*
@@ -4674,10 +4674,10 @@ static ssize_t cpu_partial_show(struct kmem_cache *s, char *buf)static ssize_t cpu_partial_store (struct kmem_cache *s,const char *buf,size_t length) { -unsigned long objects; +unsigned int objects;int err; - err =kstrtoul (buf,10 , &objects); + err =kstrtouint (buf,10 , &objects);if (err)return err;if (objects && !kmem_cache_has_cpu_partial (s))
net/6lowpan/iphc.c +1 -0
@@ -569,6 +569,7 @@ int lowpan_header_decompress(struct sk_buff *skb, const struct net_device *dev, hdr.hop_limit, &hdr.daddr);skb_push (skb,sizeof (hdr)); +skb_reset_mac_header (skb);skb_reset_network_header (skb);skb_copy_to_linear_data (skb, &hdr,sizeof (hdr));
net/mac80211/ibss.c +11 -11
@@ -948,8 +948,8 @@ static void ieee80211_rx_mgmt_deauth_ibss(struct ieee80211_sub_if_data *sdata,if (len <IEEE80211_DEAUTH_FRAME_LEN )return ; -ibss_dbg (sdata,"RX DeAuth SA=%pM DA=%pM BSSID=%pM (reason: %d)\n" , - mgmt->sa, mgmt->da, mgmt->bssid, reason); +ibss_dbg (sdata,"RX DeAuth SA=%pM DA=%pM\n" , mgmt->sa, mgmt->da); +ibss_dbg (sdata,"\tBSSID=%pM (reason: %d)\n" , mgmt->bssid, reason);sta_info_destroy_addr (sdata, mgmt->sa); }
@@ -967,9 +967,9 @@ static void ieee80211_rx_mgmt_auth_ibss(struct ieee80211_sub_if_data *sdata, auth_alg =le16_to_cpu (mgmt->u.auth.auth_alg); auth_transaction =le16_to_cpu (mgmt->u.auth.auth_transaction); -ibss_dbg (sdata, -"RX Auth SA=%pM DA=%pM BSSID=%pM (auth_transaction=%d)\n" , - mgmt->sa, mgmt->da, mgmt->bssid, auth_transaction); +ibss_dbg (sdata,"RX Auth SA=%pM DA=%pM\n" , mgmt->sa, mgmt->da); +ibss_dbg (sdata,"\tBSSID=%pM (auth_transaction=%d)\n" , + mgmt->bssid, auth_transaction);if (auth_alg !=WLAN_AUTH_OPEN || auth_transaction !=1 )return ;
@@ -1174,10 +1174,10 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, rx_timestamp =drv_get_tsf (local, sdata); } -ibss_dbg (sdata, -"RX beacon SA=%pM BSSID=%pM TSF=0x%llx BCN=0x%llx diff=%lld @%lu\n" , +ibss_dbg (sdata,"RX beacon SA=%pM BSSID=%pM TSF=0x%llx\n" , mgmt->sa, mgmt->bssid, - (unsigned long long )rx_timestamp, + (unsigned long long )rx_timestamp); +ibss_dbg (sdata,"\tBCN=0x%llx diff=%lld @%lu\n" , (unsigned long long )beacon_timestamp, (unsigned long long )(rx_timestamp - beacon_timestamp), jiffies);
@@ -1536,9 +1536,9 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata, tx_last_beacon =drv_tx_last_beacon (local); -ibss_dbg (sdata, -"RX ProbeReq SA=%pM DA=%pM BSSID=%pM (tx_last_beacon=%d)\n" , - mgmt->sa, mgmt->da, mgmt->bssid, tx_last_beacon); +ibss_dbg (sdata,"RX ProbeReq SA=%pM DA=%pM\n" , mgmt->sa, mgmt->da); +ibss_dbg (sdata,"\tBSSID=%pM (tx_last_beacon=%d)\n" , + mgmt->bssid, tx_last_beacon);if (!tx_last_beacon &&is_multicast_ether_addr (mgmt->da))return ;
net/mac80211/main.c +21 -5
@@ -253,8 +253,27 @@ static void ieee80211_restart_work(struct work_struct *work) "%s called with hardware scan in progress\n", __func__);rtnl_lock (); -list_for_each_entry (sdata, &local->interfaces, list) +list_for_each_entry (sdata, &local->interfaces, list) { +/* +* XXX: there may be more work for other vif types and even +* for station mode: a good thing would be to run most of +* the iface type's dependent _stop (ieee80211_mg_stop, +* ieee80211_ibss_stop) etc... +* For now, fix only the specific bug that was seen: race +* between csa_connection_drop_work and us. +*/ +if (sdata->vif.type ==NL80211_IFTYPE_STATION ) { +/* +* This worker is scheduled from the iface worker that +* runs on mac80211's workqueue, so we can't be +* scheduling this worker after the cancel right here. +* The exception is ieee80211_chswitch_done. +* Then we can have a race... +*/ +cancel_work_sync (&sdata->u.mgd.csa_connection_drop_work); + }flush_delayed_work (&sdata->dec_tailroom_needed_wk); + }ieee80211_scan_cancel (local);ieee80211_reconfig (local);rtnl_unlock ();
@@ -460,10 +479,7 @@ static const struct ieee80211_vht_cap mac80211_vht_capa_mod_mask = { cpu_to_le32(IEEE80211_VHT_CAP_RXLDPC | IEEE80211_VHT_CAP_SHORT_GI_80 | IEEE80211_VHT_CAP_SHORT_GI_160 | - IEEE80211_VHT_CAP_RXSTBC_1 | - IEEE80211_VHT_CAP_RXSTBC_2 | - IEEE80211_VHT_CAP_RXSTBC_3 | - IEEE80211_VHT_CAP_RXSTBC_4 | + IEEE80211_VHT_CAP_RXSTBC_MASK | IEEE80211_VHT_CAP_TXSTBC | IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE | IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
net/mac80211/mesh_hwmp.c +4 -0
@@ -552,6 +552,10 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, forward = false; reply = true; target_metric =0 ; + +if (SN_GT (target_sn, ifmsh->sn)) + ifmsh->sn = target_sn; +if (time_after (jiffies, ifmsh->last_sn_update +net_traversal_jiffies (sdata)) ||time_before (jiffies, ifmsh->last_sn_update)) {
net/mac80211/mlme.c +53 -0
71 lines not on this page · raw message
net/wireless/nl80211.c +1 -0
@@ -10014,6 +10014,7 @@ static int nl80211_update_ft_ies(struct sk_buff *skb, struct genl_info *info)return -EOPNOTSUPP ;if (!info->attrs[NL80211_ATTR_MDID ] || + !info->attrs[NL80211_ATTR_IE ] || !is_valid_ie_attr (info->attrs[NL80211_ATTR_IE ]))return -EINVAL ;
net/wireless/util.c +1 -1
@@ -1360,7 +1360,7 @@ bool ieee80211_chandef_to_operating_class(struct cfg80211_chan_def *chandef, u8 *op_class) {u8 vht_opclass; -u16 freq = chandef->center_freq1; +u32 freq = chandef->center_freq1;if (freq >=2412 && freq <=2472 ) {if (chandef->width >NL80211_CHAN_WIDTH_40 )
sound/aoa/core/gpio-feature.c +3 -1
@@ -88,8 +88,10 @@ static struct device_node *get_gpio(char *name, } reg =of_get_property (np,"reg" ,NULL ); -if (!reg) +if (!reg) { +of_node_put (np);return NULL ; + } *gpioptr = *reg;
sound/pci/hda/hda_intel.c +2 -1
@@ -2360,7 +2360,8 @@ static const struct pci_device_id azx_ids[] = { .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB },/* AMD Raven */ { PCI_DEVICE(0x1022, 0x15e3), - .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB }, + .driver_data =AZX_DRIVER_GENERIC |AZX_DCAPS_PRESET_ATI_SB | + AZX_DCAPS_PM_RUNTIME }, /* ATI HDMI */ { PCI_DEVICE(0x1002, 0x0002), .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS },
sound/pci/hda/patch_realtek.c +1 -0
@@ -5642,6 +5642,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x1028 ,0x0706 ,"Dell Inspiron 7559" ,ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER ),SND_PCI_QUIRK (0x1028 ,0x0725 ,"Dell Inspiron 3162" ,ALC255_FIXUP_DELL_SPK_NOISE ),SND_PCI_QUIRK (0x1028 ,0x075b ,"Dell XPS 13 9360" ,ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE ), +SND_PCI_QUIRK (0x1028 ,0x075c ,"Dell XPS 27 7760" ,ALC298_FIXUP_SPK_VOLUME ),SND_PCI_QUIRK (0x1028 ,0x075d ,"Dell AIO" ,ALC298_FIXUP_SPK_VOLUME ),SND_PCI_QUIRK (0x1028 ,0x07b0 ,"Dell Precision 7520" ,ALC295_FIXUP_DISABLE_DAC3 ), SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
sound/soc/soc-dapm.c +7 -0
@@ -3864,6 +3864,13 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card)continue ; } +/* let users know there is no DAI to link */ +if (!dai_w->priv) { +dev_dbg (card->dev,"dai widget %s has no DAI\n" , + dai_w->name); +continue ; + } + dai = dai_w->priv;/* ...find all widgets with the same stream and link them */
tools/perf/arch/powerpc/util/sym-handling.c +3 -1
@@ -27,15 +27,16 @@ void arch__elf_sym_adjust(GElf_Sym *sym)#endif #endif -#if !defined(_CALL_ELF) || _CALL_ELF !=2 int arch__choose_best_symbol (struct symbol *syma,struct symbol *symb__maybe_unused ) {char *sym = syma->name; +#if !defined(_CALL_ELF) || _CALL_ELF !=2 /* Skip over any initial dot */ if (*sym =='.' ) sym++; +#endif /* Avoid "SyS" kernel syscall aliases */ if (strlen (sym) >=3 && !strncmp (sym,"SyS" ,3 ))
@@ -46,6 +47,7 @@ int arch__choose_best_symbol(struct symbol *syma,return SYMBOL_A ; } +#if !defined(_CALL_ELF) || _CALL_ELF !=2 /* Allow matching against dot variants */ int arch__compare_symbol_names (const char *namea,const char *nameb) {
tools/vm/page-types.c +0 -6
@@ -150,12 +150,6 @@ static const char * const page_flag_names[] = { }; -static const char *const debugfs_known_mountpoints[] = { -"/sys/kernel/debug" , -"/debug" , -0 , -}; -/* * data structures */
tools/vm/slabinfo.c +2 -2
@@ -29,8 +29,8 @@ struct slabinfo {int alias;int refs;int aliases, align, cache_dma, cpu_slabs, destroy_by_rcu; -int hwcache_align, object_size, objs_per_slab; -int sanity_checks, slab_size, store_user, trace; +unsigned int hwcache_align, object_size, objs_per_slab; +unsigned int sanity_checks, slab_size, store_user, trace;int order, poison, reclaim_account, red_zone;unsigned long partial, objects, slabs, objects_partial, objects_total;unsigned long alloc_fastpath, alloc_slowpath;