Linux 4.9.238
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.9.238 kernel.
All users of the 4.9 kernel series must upgrade.
The updated 4.9.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.9.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/DocBook/libata.tmpl | 2 Documentation/devicetree/bindings/sound/wm8994.txt | 18 +- Makefile | 2 arch/m68k/q40/config.c | 1 arch/mips/include/asm/cpu-type.h | 1 arch/s390/kernel/setup.c | 6 arch/x86/include/asm/nospec-branch.h | 4 arch/x86/include/asm/pkeys.h | 5 arch/x86/kernel/fpu/xstate.c | 9 + arch/x86/kvm/mmutrace.h | 2 arch/x86/kvm/x86.c | 10 + drivers/acpi/ec.c | 16 -- drivers/ata/acard-ahci.c | 6 drivers/ata/libahci.c | 6 drivers/ata/libata-core.c | 9 + drivers/ata/libata-sff.c | 12 + drivers/ata/pata_macio.c | 6 drivers/ata/pata_pxa.c | 8 - drivers/ata/pdc_adma.c | 7 - drivers/ata/sata_fsl.c | 4 drivers/ata/sata_inic162x.c | 4 drivers/ata/sata_mv.c | 34 ++--- drivers/ata/sata_nv.c | 18 +- drivers/ata/sata_promise.c | 6 drivers/ata/sata_qstor.c | 8 - drivers/ata/sata_rcar.c | 6 drivers/ata/sata_sil.c | 8 - drivers/ata/sata_sil24.c | 6 drivers/ata/sata_sx4.c | 6 drivers/atm/eni.c | 2 drivers/char/tlclk.c | 17 +- drivers/char/tpm/tpm_ibmvtpm.c | 9 + drivers/char/tpm/tpm_ibmvtpm.h | 1 drivers/clk/ti/adpll.c | 11 - drivers/clocksource/h8300_timer8.c | 2 drivers/cpufreq/powernv-cpufreq.c | 13 + drivers/devfreq/tegra-devfreq.c | 4 drivers/dma/tegra20-apb-dma.c | 3 drivers/dma/xilinx/zynqmp_dma.c | 24 ++- drivers/gpu/drm/amd/amdgpu/atom.c | 4 drivers/gpu/drm/gma500/cdv_intel_display.c | 2 drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c | 4 drivers/i2c/i2c-core.c | 2 drivers/infiniband/core/ucma.c | 6 drivers/infiniband/hw/cxgb4/cm.c | 4 drivers/infiniband/hw/i40iw/i40iw_cm.c | 2 drivers/infiniband/sw/rxe/rxe_qp.c | 7 - drivers/md/bcache/bcache.h | 1 drivers/md/bcache/btree.c | 12 + drivers/md/bcache/super.c | 1 drivers/media/dvb-frontends/tda10071.c | 9 - drivers/media/platform/ti-vpe/cal.c | 6 drivers/media/usb/go7007/go7007-usb.c | 4 drivers/mfd/mfd-core.c | 10 + drivers/mtd/chips/cfi_cmdset_0002.c | 1 drivers/mtd/cmdlinepart.c | 23 +++ drivers/mtd/nand/omap_elm.c | 1 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 31 +++- drivers/net/ethernet/intel/e1000/e1000_main.c | 18 ++ drivers/net/ieee802154/adf7242.c | 4 drivers/net/phy/phy_device.c | 3 drivers/net/wan/hdlc_ppp.c | 16 +- drivers/net/wireless/ath/ar5523/ar5523.c | 2 drivers/net/wireless/marvell/mwifiex/fw.h | 2 drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c | 4 drivers/phy/phy-s5pv210-usb2.c | 4 drivers/scsi/aacraid/aachba.c | 8 - drivers/scsi/lpfc/lpfc_ct.c | 137 ++++++++++----------- drivers/scsi/lpfc/lpfc_hw.h | 36 ++--- drivers/scsi/lpfc/lpfc_sli.c | 4 drivers/tty/serial/8250/8250_core.c | 11 + drivers/tty/serial/8250/8250_omap.c | 8 - drivers/tty/serial/8250/8250_port.c | 16 ++ drivers/tty/serial/samsung.c | 8 - drivers/usb/host/ehci-mv.c | 8 - drivers/vfio/pci/vfio_pci.c | 13 + fs/block_dev.c | 10 + fs/btrfs/extent-tree.c | 2 fs/ceph/caps.c | 14 +- fs/cifs/cifsglob.h | 9 - fs/cifs/file.c | 21 ++- fs/cifs/misc.c | 17 -- fs/cifs/smb1ops.c | 8 - fs/cifs/smb2misc.c | 32 +--- fs/cifs/smb2ops.c | 44 ++++-- fs/cifs/smb2pdu.h | 2 fs/fuse/dev.c | 1 fs/ubifs/io.c | 16 ++ fs/xfs/libxfs/xfs_attr_leaf.c | 4 fs/xfs/libxfs/xfs_dir2_node.c | 1 include/linux/debugfs.h | 5 include/linux/libata.h | 13 + include/linux/mtd/map.h | 2 include/linux/seqlock.h | 11 + include/linux/skbuff.h | 16 ++ kernel/audit_watch.c | 2 kernel/bpf/hashtab.c | 8 - kernel/kprobes.c | 14 +- kernel/printk/printk.c | 3 kernel/sys.c | 4 kernel/time/timekeeping.c | 3 kernel/trace/trace.c | 5 kernel/trace/trace_entries.h | 2 kernel/trace/trace_events.c | 2 lib/string.c | 24 +++ mm/filemap.c | 8 + mm/mmap.c | 2 mm/pagewalk.c | 4 net/atm/lec.c | 6 net/batman-adv/bridge_loop_avoidance.c | 42 ++++-- net/batman-adv/bridge_loop_avoidance.h | 4 net/batman-adv/routing.c | 4 net/batman-adv/soft-interface.c | 6 net/bluetooth/hci_event.c | 25 +++ net/bluetooth/l2cap_core.c | 29 ++-- net/bluetooth/l2cap_sock.c | 18 ++ net/core/neighbour.c | 1 net/hsr/hsr_device.c | 3 net/ipv4/ip_output.c | 3 net/ipv4/route.c | 1 net/key/af_key.c | 7 + net/mac802154/tx.c | 8 - net/sunrpc/svc_xprt.c | 19 ++ net/sunrpc/xprtrdma/svc_rdma_backchannel.c | 1 net/tipc/msg.c | 3 net/unix/af_unix.c | 11 + security/selinux/selinuxfs.c | 1 sound/hda/hdac_bus.c | 4 sound/pci/asihpi/hpioctl.c | 4 sound/pci/hda/hda_controller.c | 11 + sound/soc/kirkwood/kirkwood-dma.c | 2 sound/usb/midi.c | 29 +++- sound/usb/quirks.c | 7 - tools/gpio/gpio-hammer.c | 17 ++ tools/objtool/check.c | 2 tools/perf/util/sort.c | 2 tools/perf/util/symbol-elf.c | 7 + tools/testing/selftests/x86/syscall_nt.c | 1 virt/kvm/kvm_main.c | 22 +-- 139 files changed, 894 insertions(+), 463 deletions(-)
Adrian Hunter (1):
perf kcore_copy: Fix module map when there are no modules loaded
Alain Michaud (1):
Bluetooth: guard against controllers sending zero'd events
Alex Williamson (1):
vfio/pci: Clear error and request eventfd ctx after releasing
Alexander Duyck (1):
e1000: Do not perform reset in reset_task if we are already down
Andreas Steinmetz (1):
ALSA: usb-audio: Fix case when USB MIDI interface has more than one extra endpoint descriptor
Andy Lutomirski (1):
selftests/x86/syscall_nt: Clear weird flags after each test
Balsundar P (1):
scsi: aacraid: fix illegal IO beyond last LBA
Bart Van Assche (1):
RDMA/rxe: Fix configuration of atomic queue pair attributes
Ben Hutchings (1):
mtd: Fix comparison in map_word_andequal()
Boris Brezillon (1):
mtd: parser: cmdline: Support MTD names containing one or more colons
Brian Foster (1):
xfs: fix attr leaf header freemap.size underflow
Christophe JAILLET (2):
RDMA/iw_cgxb4: Fix an error handling path in 'c4iw_connect()'
SUNRPC: Fix a potential buffer overflow in 'svc_print_xprts()'
Chuck Lever (1):
svcrdma: Fix leak of transport addresses
Colin Ian King (2):
media: tda10071: fix unsigned sign extension overflow
USB: EHCI: ehci-mv: fix less than zero comparison of an unsigned int
Cong Wang (1):
atm: fix a memory leak of vcc->user_back
Dan Carpenter (1):
hdlc_ppp: add range checks in ppp_cp_parse_cr()
Darrick J. Wong (1):
xfs: don't ever return a stale pointer from __xfs_dir3_free_read
Dave Hansen (1):
x86/pkeys: Add check for pkey "overflow"
David Sterba (1):
btrfs: don't force read-only after error in drop snapshot
Dinghao Liu (1):
mtd: rawnand: omap_elm: Fix runtime PM imbalance on error
Divya Indi (1):
tracing: Adding NULL checks for trace_array descriptor pointer
Dmitry Osipenko (2):
PM / devfreq: tegra30: Fix integer overflow on CPU's freq max out
dmaengine: tegra-apb: Prevent race conditions on channel's freeing
Douglas Anderson (1):
bdev: Reduce time holding bd_mutex in sync in blkdev_close()
Eric Dumazet (2):
net: add __must_check to skb_put_padto()
mac802154: tx: fix use-after-free
Florian Fainelli (2):
net: phy: Avoid NPD upon phy_detach() when driver is unbound net/hsr: Check skb_put_padto() return value
Fuqian Huang (1):
m68k: q40: Fix info-leak in rtc_ioctl
Gabriel Ravier (1):
tools: gpio-hammer: Avoid potential overflow in main
Greg Kroah-Hartman (1):
Linux 4.9.238
Guoju Fang (1):
bcache: fix a lost wake-up problem caused by mca_cannibalize_lock
Hans de Goede (1):
i2c: core: Call i2c_acpi_install_space_handler() before i2c_acpi_register_devices()
Hillf Danton (1):
Bluetooth: prefetch channel before killing sock
Hou Tao (1):
mtd: cfi_cmdset_0002: don't free cfi->cfiq in error path of cfi_amdstd_setup()
Howard Chung (1):
Bluetooth: L2CAP: handle l2cap config request during open state
Ilya Leoshkevich (1):
s390/init: add missing __init annotations
Jaewon Kim (1):
mm/mmap.c: initialize align_offset explicitly for vm_unmapped_area
James Smart (2):
scsi: lpfc: Fix RQ buffer leakage when no IOCBs available
scsi: lpfc: Fix coverity errors in fmdi attribute handling
Jeff Layton (1):
ceph: fix potential race in ceph_check_caps
Jing Xiangfeng (1):
atm: eni: fix the missed pci_disable_device() for eni_init_one()
Jiri Slaby (3):
ata: define AC_ERR_OK
ata: make qc_prep return ata_completion_errors
ata: sata_mv, avoid trigerrable BUG_ON
Joakim Tjernlund (1):
ALSA: usb-audio: Add delay quirk for H570e USB headsets
Joe Perches (1):
kernel/sys.c: avoid copying possible padding bytes in copy_to_user
John Clements (1):
drm/amdgpu: increase atombios cmd timeout
Jonathan Bakker (2):
phy: samsung: s5pv210-usb2: Add delay after reset
tty: serial: samsung: Correct clock selection logic
Josef Bacik (1):
tracing: Set kernel_stack's caller size properly
Josh Poimboeuf (1):
objtool: Fix noreturn detection for ignored functions
Kangjie Lu (1):
gma/gma500: fix a memory disclosure bug due to uninitialized bytes
Krzysztof Kozlowski (1):
dt-bindings: sound: wm8994: Correct required supplies based on actual implementaion
Kusanagi Kouichi (1):
debugfs: Fix !DEBUG_FS debugfs_create_automount
Lee Jones (1):
mfd: mfd-core: Protect against NULL call-back function pointer
Linus Lüssing (3):
batman-adv: bla: fix type misuse for backbone_gw hash indexing
batman-adv: mcast/TT: fix wrongly dropped or rerouted packets
batman-adv: mcast: fix duplicate mcast packets in BLA backbone from mesh
Liu Song (1):
ubifs: Fix out-of-bounds memory access caused by abnormal value of node_len
Lukas Wunner (1):
serial: 8250: Avoid error message on reprobe
Madhuparna Bhowmik (1):
drivers: char: tlclk.c: Avoid data race between init and interrupt handler
Manish Mandlik (1):
Bluetooth: Fix refcount use-after-free issue
Marco Elver (1):
seqlock: Require WRITE_ONCE surrounding raw_seqcount_barrier
Mark Salyzyn (1):
af_key: pfkey_dump needs parameter validation
Masami Hiramatsu (1):
kprobes: Fix to check probe enabled before disarm_kprobe_ftrace()
Matthias Fend (1):
dmaengine: zynqmp_dma: fix burst length configuration
Maximilian Luz (1):
mwifiex: Increase AES key storage size to 256 bits
Mert Dirik (1):
ar5523: Add USB ID of SMCWUSBT-G2 wireless adapter
Michael Chan (1):
bnxt_en: Protect bnxt_set_eee() and bnxt_set_pauseparam() with mutex.
Miklos Szeredi (1):
fuse: don't check refcount after stealing page
Mohan Kumar (1):
ALSA: hda: Clear RIRB status before reading WP
Muchun Song (1):
kprobes: fix kill kprobe which has been marked as gone
Nathan Chancellor (1):
tracing: Use address-of operator on section symbols
Nick Desaulniers (1):
lib/string.c: implement stpcpy
Nikhil Devshatwar (1):
media: ti-vpe: cal: Restrict DMA to avoid memory corruption
Pan Bian (1):
RDMA/i40iw: Fix potential use after free
Paolo Bonzini (1):
KVM: x86: fix incorrect comparison in trace event
Pavel Shilovsky (1):
CIFS: Properly process SMB3 lease breaks
Peter Ujfalusi (1):
serial: 8250_omap: Fix sleeping function called from invalid context during probe
Pratik Rajesh Sampat (1):
cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_work_fn
Qian Cai (2):
skbuff: fix a data race in skb_queue_len()
vfio/pci: fix memory leaks of eventfd ctx
Rafael J. Wysocki (1):
ACPI: EC: Reference count query handlers under lock
Russell King (1):
ASoC: kirkwood: fix IRQ error handling
Rustam Kovhaev (1):
KVM: fix memory leak in kvm_io_bus_unregister_dev()
Shamir Rabinovitch (1):
RDMA/ucma: ucma_context reference leak in error path
Shreyas Joshi (1):
printk: handle blank console arguments passed in.
Sonny Sasaka (1):
Bluetooth: Handle Inquiry Cancel error after Inquiry Complete
Stefan Berger (1):
tpm: ibmvtpm: Wait for buffer to be set before proceeding
Stephen Kitt (1):
clk/ti/adpll: allocate room for terminating null
Steve Grubb (1):
audit: CONFIG_CHANGE don't log internal bookkeeping as an event
Steve Rutherford (1):
KVM: Remove CREATE_IRQCHIP/SET_PIT2 race
Steven Price (1):
mm: pagewalk: fix termination condition in walk_pte_range()
Sven Eckelmann (1):
batman-adv: Add missing include for in_interrupt()
Takashi Iwai (2):
media: go7007: Fix URB type for interrupt handling
ALSA: hda: Fix potential race in unsol event handler
Tang Bin (1):
USB: EHCI: ehci-mv: fix error handling in mv_ehci_probe()
Thomas Gleixner (2):
bpf: Remove recursion prevention from rcu free callback x86/speculation/mds: Mark mds_user_clear_cpu_buffers() __always_inline
Tianjia Zhang (1):
clocksource/drivers/h8300_timer8: Fix wrong return value in h8300_8timer_init()
Tom Rix (2):
ieee802154/adf7242: check status of adf7242_read_reg
ALSA: asihpi: fix iounmap in error handler
Vasily Averin (3):
neigh_stat_seq_next() should increase position index rt_cpu_seq_next should increase position index
selinux: sel_avc_get_stat_idx should increase position index
Vignesh Raghavendra (2):
serial: 8250_port: Don't service RX FIFO if throttled
serial: 8250: 8250_omap: Terminate DMA before pushing data on RX timeout
Wei Li (1):
MIPS: Add the missing 'CPU_1074K' into __get_cpu_type()
Wei Wang (1):
ip: fix tos reflection in ack and reset packets
Wen Yang (2):
drm/omap: fix possible object reference leak
timekeeping: Prevent 32bit truncation in scale64_check_overflow()
Xianting Tian (1):
mm/filemap.c: clear page error before actual read
Xie XiuQi (1):
perf util: Fix memory leak of prefix_if_not_in
Xin Long (1):
tipc: use skb_unshare() instead in tipc_buf_append()
Zeng Tao (1):
vfio/pci: fix racy on error and request eventfd ctx
Zhang Xiaoxu (1):
cifs: Fix double add page to memcg when cifs_readpages
Zhuang Yanying (1):
KVM: fix overflow of zero page refcount with ksm running
Greg Kroah-Hartman
maintainerDocumentation/DocBook/libata.tmpl +1 -1
@@ -324,7 +324,7 @@ Many legacy IDE drivers use ata_bmdma_status() as the bmdma_status() hook. <sect2><title>High-level taskfile hooks</title> <programlisting> -void (*qc_prep) (struct ata_queued_cmd *qc); +enum ata_completion_errors (*qc_prep) (struct ata_queued_cmd *qc); int (*qc_issue) (struct ata_queued_cmd *qc); </programlisting>
Documentation/devicetree/bindings/sound/wm8994.txt +12 -6
@@ -14,9 +14,15 @@ Required properties: - #gpio-cells : Must be 2. The first cell is the pin number and the second cell is used to specify optional parameters (currently unused). - - AVDD2-supply, DBVDD1-supply, DBVDD2-supply, DBVDD3-supply, CPVDD-supply, - SPKVDD1-supply, SPKVDD2-supply : power supplies for the device, as covered - in Documentation/devicetree/bindings/regulator/regulator.txt + - power supplies for the device, as covered in + Documentation/devicetree/bindings/regulator/regulator.txt, depending + on compatible: + - for wlf,wm1811 and wlf,wm8958: + AVDD1-supply, AVDD2-supply, DBVDD1-supply, DBVDD2-supply, DBVDD3-supply, + DCVDD-supply, CPVDD-supply, SPKVDD1-supply, SPKVDD2-supply + - for wlf,wm8994: + AVDD1-supply, AVDD2-supply, DBVDD-supply, DCVDD-supply, CPVDD-supply, + SPKVDD1-supply, SPKVDD2-supply Optional properties:
@@ -68,11 +74,11 @@ codec: wm8994@1a { lineout1-se; + AVDD1-supply = <®ulator>; AVDD2-supply = <®ulator>; CPVDD-supply = <®ulator>; - DBVDD1-supply = <®ulator>; - DBVDD2-supply = <®ulator>; - DBVDD3-supply = <®ulator>; + DBVDD-supply = <®ulator>; + DCVDD-supply = <®ulator>; SPKVDD1-supply = <®ulator>; SPKVDD2-supply = <®ulator>; };
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 9 -SUBLEVEL = 237 +SUBLEVEL = 238 EXTRAVERSION = NAME = Roaring Lionus
arch/m68k/q40/config.c +1 -0
@@ -303,6 +303,7 @@ static int q40_get_rtc_pll(struct rtc_pll_info *pll) {int tmp =Q40_RTC_CTRL ; + pll->pll_ctrl =0 ; pll->pll_value = tmp &Q40_RTC_PLL_MASK ;if (tmp &Q40_RTC_PLL_SIGN ) pll->pll_value = -pll->pll_value;
arch/mips/include/asm/cpu-type.h +1 -0
@@ -47,6 +47,7 @@ static inline int __pure __get_cpu_type(const int cpu_type)case CPU_34K :case CPU_1004K :case CPU_74K : +case CPU_1074K :case CPU_M14KC :case CPU_M14KEC :case CPU_INTERAPTIV :
arch/s390/kernel/setup.c +3 -3
@@ -529,7 +529,7 @@ static struct notifier_block kdump_mem_nb = {/* * Make sure that the area behind memory_end is protected */ -static void reserve_memory_end (void ) +static void __init reserve_memory_end (void ) {#ifdef CONFIG_CRASH_DUMP if (ipl_info.type == IPL_TYPE_FCP_DUMP &&
@@ -547,7 +547,7 @@ static void reserve_memory_end(void)/* * Make sure that oldmem, where the dump is stored, is protected */ -static void reserve_oldmem (void ) +static void __init reserve_oldmem (void ) {#ifdef CONFIG_CRASH_DUMP if (OLDMEM_BASE )
@@ -559,7 +559,7 @@ static void reserve_oldmem(void)/* * Make sure that oldmem, where the dump is stored, is protected */ -static void remove_oldmem (void ) +static void __init remove_oldmem (void ) {#ifdef CONFIG_CRASH_DUMP if (OLDMEM_BASE )
arch/x86/include/asm/nospec-branch.h +2 -2
@@ -321,7 +321,7 @@ DECLARE_STATIC_KEY_FALSE(mds_idle_clear);* combination with microcode which triggers a CPU buffer flush when the * instruction is executed. */ -static inline void mds_clear_cpu_buffers (void ) +static __always_inline void mds_clear_cpu_buffers(void) {static const u16 ds = __KERNEL_DS;
@@ -342,7 +342,7 @@ static inline void mds_clear_cpu_buffers(void)* * Clear CPU buffers if the corresponding static key is enabled */ -static inline void mds_user_clear_cpu_buffers (void ) +static __always_inline void mds_user_clear_cpu_buffers(void) {if (static_branch_likely (&mds_user_clear))mds_clear_cpu_buffers ();
arch/x86/include/asm/pkeys.h +5 -0
@@ -3,6 +3,11 @@#define ARCH_DEFAULT_PKEY 0 +/* +* If more than 16 keys are ever supported, a thorough audit +* will be necessary to ensure that the types that store key +* numbers and masks have sufficient capacity. +*/ #define arch_max_pkey () (boot_cpu_has(X86_FEATURE_OSPKE) ? 16 : 1) extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
arch/x86/kernel/fpu/xstate.c +7 -2
@@ -871,8 +871,6 @@ const void *get_xsave_field_ptr(int xsave_state)#ifdef CONFIG_ARCH_HAS_PKEYS -#define NR_VALID_PKRU_BITS (CONFIG_NR_PROTECTION_KEYS * 2) -#define PKRU_VALID_MASK (NR_VALID_PKRU_BITS - 1)/* * This will go out and modify PKRU register to set the access * rights for @pkey to @init_val.
@@ -891,6 +889,13 @@ int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,if (!boot_cpu_has (X86_FEATURE_OSPKE ))return -EINVAL ; +/* +* This code should only be called with valid 'pkey' +* values originating from in-kernel users. Complain +* if a bad value is observed. +*/ +WARN_ON_ONCE (pkey >=arch_max_pkey ()); +/* Set the bits we need in PKRU: */ if (init_val &PKEY_DISABLE_ACCESS ) new_pkru_bits |=PKRU_AD_BIT ;
arch/x86/kvm/mmutrace.h +1 -1
@@ -336,7 +336,7 @@ TRACE_EVENT(/* These depend on page entry type, so compute them now. */ __field(bool, r) __field(bool, x) -__field (u8, u) + __field(signed char, u) ), TP_fast_assign(
arch/x86/kvm/x86.c +8 -2
@@ -4263,10 +4263,13 @@ long kvm_arch_vm_ioctl(struct file *filp, r = -EFAULT ;if (copy_from_user (&u.ps, argp,sizeof u.ps)) goto out; +mutex_lock (&kvm->lock); r = -ENXIO ;if (!kvm->arch.vpit) - goto out; + goto set_pit_out; r =kvm_vm_ioctl_set_pit (kvm, &u.ps); +set_pit_out: +mutex_unlock (&kvm->lock);break ; }case KVM_GET_PIT2 : {
@@ -4286,10 +4289,13 @@ long kvm_arch_vm_ioctl(struct file *filp, r = -EFAULT ;if (copy_from_user (&u.ps2, argp,sizeof (u.ps2))) goto out; +mutex_lock (&kvm->lock); r = -ENXIO ;if (!kvm->arch.vpit) - goto out; + goto set_pit2_out; r =kvm_vm_ioctl_set_pit2 (kvm, &u.ps2); +set_pit2_out: +mutex_unlock (&kvm->lock);break ; }case KVM_REINJECT_CONTROL : {
drivers/acpi/ec.c +4 -12
@@ -1049,29 +1049,21 @@ void acpi_ec_unblock_transactions(void)/* -------------------------------------------------------------------------- Event Management -------------------------------------------------------------------------- */ -static struct acpi_ec_query_handler * -acpi_ec_get_query_handler (struct acpi_ec_query_handler *handler) -{ -if (handler) -kref_get (&handler->kref); -return handler; -} -static struct acpi_ec_query_handler *acpi_ec_get_query_handler_by_value (struct acpi_ec *ec,u8 value) {struct acpi_ec_query_handler *handler; -bool found = false;mutex_lock (&ec->mutex);list_for_each_entry (handler, &ec->list, node) {if (value == handler->query_bit) { - found = true; -break ; +kref_get (&handler->kref); +mutex_unlock (&ec->mutex); +return handler; } }mutex_unlock (&ec->mutex); -return found ?acpi_ec_get_query_handler (handler) :NULL ; +return NULL ; }static void acpi_ec_query_handler_release (struct kref *kref)
drivers/ata/acard-ahci.c +4 -2
@@ -72,7 +72,7 @@ struct acard_sg {__le32 size;/* bit 31 (EOT) max==0x10000 (64k) */ }; -static void acard_ahci_qc_prep (struct ata_queued_cmd *qc); +static enum ata_completion_errors acard_ahci_qc_prep (struct ata_queued_cmd *qc);static bool acard_ahci_qc_fill_rtf (struct ata_queued_cmd *qc);static int acard_ahci_port_start (struct ata_port *ap);static int acard_ahci_init_one (struct pci_dev *pdev,const struct pci_device_id *ent);
@@ -257,7 +257,7 @@ static unsigned int acard_ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl)return si; } -static void acard_ahci_qc_prep (struct ata_queued_cmd *qc) +static enum ata_completion_errors acard_ahci_qc_prep (struct ata_queued_cmd *qc) {struct ata_port *ap = qc->ap;struct ahci_port_priv *pp = ap->private_data;
@@ -295,6 +295,8 @@ static void acard_ahci_qc_prep(struct ata_queued_cmd *qc) opts |=AHCI_CMD_ATAPI |AHCI_CMD_PREFETCH ;ahci_fill_cmd_slot (pp, qc->tag, opts); + +return AC_ERR_OK ; }static bool acard_ahci_qc_fill_rtf (struct ata_queued_cmd *qc)
drivers/ata/libahci.c +4 -2
@@ -73,7 +73,7 @@ static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);static bool ahci_qc_fill_rtf (struct ata_queued_cmd *qc);static int ahci_port_start (struct ata_port *ap);static void ahci_port_stop (struct ata_port *ap); -static void ahci_qc_prep (struct ata_queued_cmd *qc); +static enum ata_completion_errors ahci_qc_prep (struct ata_queued_cmd *qc);static int ahci_pmp_qc_defer (struct ata_queued_cmd *qc);static void ahci_freeze (struct ata_port *ap);static void ahci_thaw (struct ata_port *ap);
@@ -1607,7 +1607,7 @@ static int ahci_pmp_qc_defer(struct ata_queued_cmd *qc)return sata_pmp_qc_defer_cmd_switch (qc); } -static void ahci_qc_prep (struct ata_queued_cmd *qc) +static enum ata_completion_errors ahci_qc_prep (struct ata_queued_cmd *qc) {struct ata_port *ap = qc->ap;struct ahci_port_priv *pp = ap->private_data;
@@ -1643,6 +1643,8 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc) opts |=AHCI_CMD_ATAPI |AHCI_CMD_PREFETCH ;ahci_fill_cmd_slot (pp, qc->tag, opts); + +return AC_ERR_OK ; }static void ahci_fbs_dec_intr (struct ata_port *ap)
drivers/ata/libata-core.c +7 -2
@@ -4895,7 +4895,10 @@ int ata_std_qc_defer(struct ata_queued_cmd *qc)return ATA_DEFER_LINK ; } -void ata_noop_qc_prep (struct ata_queued_cmd *qc) { } +enum ata_completion_errors ata_noop_qc_prep (struct ata_queued_cmd *qc) +{ +return AC_ERR_OK ; +}/** * ata_sg_init - Associate command with scatter-gather table.
@@ -5313,7 +5316,9 @@ void ata_qc_issue(struct ata_queued_cmd *qc)return ; } - ap->ops->qc_prep (qc); + qc->err_mask |= ap->ops->qc_prep (qc); +if (unlikely (qc->err_mask)) + goto err;trace_ata_qc_issue (qc); qc->err_mask |= ap->ops->qc_issue (qc);if (unlikely (qc->err_mask))
drivers/ata/libata-sff.c +8 -4
@@ -2742,12 +2742,14 @@ static void ata_bmdma_fill_sg_dumb(struct ata_queued_cmd *qc)* LOCKING: * spin_lock_irqsave(host lock) */ -void ata_bmdma_qc_prep (struct ata_queued_cmd *qc) +enum ata_completion_errors ata_bmdma_qc_prep (struct ata_queued_cmd *qc) {if (!(qc->flags &ATA_QCFLAG_DMAMAP )) -return ; +return AC_ERR_OK ;ata_bmdma_fill_sg (qc); + +return AC_ERR_OK ; }EXPORT_SYMBOL_GPL (ata_bmdma_qc_prep);
@@ -2760,12 +2762,14 @@ EXPORT_SYMBOL_GPL(ata_bmdma_qc_prep);* LOCKING: * spin_lock_irqsave(host lock) */ -void ata_bmdma_dumb_qc_prep (struct ata_queued_cmd *qc) +enum ata_completion_errors ata_bmdma_dumb_qc_prep (struct ata_queued_cmd *qc) {if (!(qc->flags &ATA_QCFLAG_DMAMAP )) -return ; +return AC_ERR_OK ;ata_bmdma_fill_sg_dumb (qc); + +return AC_ERR_OK ; }EXPORT_SYMBOL_GPL (ata_bmdma_dumb_qc_prep);
drivers/ata/pata_macio.c +4 -2
@@ -507,7 +507,7 @@ static int pata_macio_cable_detect(struct ata_port *ap)return ATA_CBL_PATA40 ; } -static void pata_macio_qc_prep (struct ata_queued_cmd *qc) +static enum ata_completion_errors pata_macio_qc_prep (struct ata_queued_cmd *qc) {unsigned int write = (qc->tf.flags &ATA_TFLAG_WRITE );struct ata_port *ap = qc->ap;
@@ -520,7 +520,7 @@ static void pata_macio_qc_prep(struct ata_queued_cmd *qc) __func__, qc, qc->flags, write, qc->dev->devno);if (!(qc->flags &ATA_QCFLAG_DMAMAP )) -return ; +return AC_ERR_OK ; table = (struct dbdma_cmd *) priv->dma_table_cpu;
@@ -565,6 +565,8 @@ static void pata_macio_qc_prep(struct ata_queued_cmd *qc) table->command =cpu_to_le16 (DBDMA_STOP );dev_dbgdma (priv->dev,"%s: %d DMA list entries\n" , __func__, pi); + +return AC_ERR_OK ; }
drivers/ata/pata_pxa.c +5 -3
@@ -59,25 +59,27 @@ static void pxa_ata_dma_irq(void *d)/* * Prepare taskfile for submission. */ -static void pxa_qc_prep (struct ata_queued_cmd *qc) +static enum ata_completion_errors pxa_qc_prep (struct ata_queued_cmd *qc) {struct pata_pxa_data *pd = qc->ap->private_data;struct dma_async_tx_descriptor *tx;enum dma_transfer_direction dir;if (!(qc->flags &ATA_QCFLAG_DMAMAP )) -return ; +return AC_ERR_OK ; dir = (qc->dma_dir ==DMA_TO_DEVICE ?DMA_MEM_TO_DEV :DMA_DEV_TO_MEM ); tx =dmaengine_prep_slave_sg (pd->dma_chan, qc->sg, qc->n_elem, dir,DMA_PREP_INTERRUPT );if (!tx) {ata_dev_err (qc->dev,"prep_slave_sg() failed\n" ); -return ; +return AC_ERR_OK ; } tx->callback = pxa_ata_dma_irq; tx->callback_param = pd; pd->dma_cookie =dmaengine_submit (tx); + +return AC_ERR_OK ; }/*
drivers/ata/pdc_adma.c +4 -3
@@ -132,7 +132,7 @@ static int adma_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);static int adma_port_start (struct ata_port *ap);static void adma_port_stop (struct ata_port *ap); -static void adma_qc_prep (struct ata_queued_cmd *qc); +static enum ata_completion_errors adma_qc_prep (struct ata_queued_cmd *qc);static unsigned int adma_qc_issue (struct ata_queued_cmd *qc);static int adma_check_atapi_dma (struct ata_queued_cmd *qc);static void adma_freeze (struct ata_port *ap);
@@ -311,7 +311,7 @@ static int adma_fill_sg(struct ata_queued_cmd *qc)return i; } -static void adma_qc_prep (struct ata_queued_cmd *qc) +static enum ata_completion_errors adma_qc_prep (struct ata_queued_cmd *qc) {struct adma_port_priv *pp = qc->ap->private_data;u8 *buf = pp->pkt;
@@ -322,7 +322,7 @@ static void adma_qc_prep(struct ata_queued_cmd *qc)adma_enter_reg_mode (qc->ap);if (qc->tf.protocol !=ATA_PROT_DMA ) -return ; +return AC_ERR_OK ; buf[i++] =0 ;/* Response flags */ buf[i++] =0 ;/* reserved */
@@ -387,6 +387,7 @@ static void adma_qc_prep(struct ata_queued_cmd *qc) printk("%s\n", obuf); }#endif +return AC_ERR_OK ; }static inline void adma_packet_start (struct ata_queued_cmd *qc)
drivers/ata/sata_fsl.c +3 -1
@@ -513,7 +513,7 @@ static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,return num_prde; } -static void sata_fsl_qc_prep (struct ata_queued_cmd *qc) +static enum ata_completion_errors sata_fsl_qc_prep (struct ata_queued_cmd *qc) {struct ata_port *ap = qc->ap;struct sata_fsl_port_priv *pp = ap->private_data;
@@ -559,6 +559,8 @@ static void sata_fsl_qc_prep(struct ata_queued_cmd *qc)VPRINTK ("SATA FSL : xx_qc_prep, di = 0x%x, ttl = %d, num_prde = %d\n" , desc_info, ttl_dwords, num_prde); + +return AC_ERR_OK ; }static unsigned int sata_fsl_qc_issue (struct ata_queued_cmd *qc)
drivers/ata/sata_inic162x.c +3 -1
@@ -472,7 +472,7 @@ static void inic_fill_sg(struct inic_prd *prd, struct ata_queued_cmd *qc) prd[-1 ].flags |=PRD_END ; } -static void inic_qc_prep (struct ata_queued_cmd *qc) +static enum ata_completion_errors inic_qc_prep (struct ata_queued_cmd *qc) {struct inic_port_priv *pp = qc->ap->private_data;struct inic_pkt *pkt = pp->pkt;
@@ -532,6 +532,8 @@ static void inic_qc_prep(struct ata_queued_cmd *qc)inic_fill_sg (prd, qc); pp->cpb_tbl[0 ] = pp->pkt_dma; + +return AC_ERR_OK ; }static unsigned int inic_qc_issue (struct ata_queued_cmd *qc)
drivers/ata/sata_mv.c +18 -16
@@ -605,8 +605,8 @@ static int mv5_scr_write(struct ata_link *link, unsigned int sc_reg_in, u32 val)static int mv_port_start (struct ata_port *ap);static void mv_port_stop (struct ata_port *ap);static int mv_qc_defer (struct ata_queued_cmd *qc); -static void mv_qc_prep (struct ata_queued_cmd *qc); -static void mv_qc_prep_iie (struct ata_queued_cmd *qc); +static enum ata_completion_errors mv_qc_prep (struct ata_queued_cmd *qc); +static enum ata_completion_errors mv_qc_prep_iie (struct ata_queued_cmd *qc);static unsigned int mv_qc_issue (struct ata_queued_cmd *qc);static int mv_hardreset (struct ata_link *link,unsigned int *class,unsigned long deadline);
@@ -2044,7 +2044,7 @@ static void mv_rw_multi_errata_sata24(struct ata_queued_cmd *qc)* LOCKING: * Inherited from caller. */ -static void mv_qc_prep (struct ata_queued_cmd *qc) +static enum ata_completion_errors mv_qc_prep (struct ata_queued_cmd *qc) {struct ata_port *ap = qc->ap;struct mv_port_priv *pp = ap->private_data;
@@ -2056,15 +2056,15 @@ static void mv_qc_prep(struct ata_queued_cmd *qc)switch (tf->protocol) {case ATA_PROT_DMA :if (tf->command ==ATA_CMD_DSM ) -return ; +return AC_ERR_OK ;/* fall-thru */ case ATA_PROT_NCQ :break ;/* continue below */ case ATA_PROT_PIO :mv_rw_multi_errata_sata24 (qc); -return ; +return AC_ERR_OK ;default : -return ; +return AC_ERR_OK ; }/* Fill in command request block
@@ -2111,12 +2111,10 @@ static void mv_qc_prep(struct ata_queued_cmd *qc)* non-NCQ mode are: [RW] STREAM DMA and W DMA FUA EXT, none * of which are defined/used by Linux. If we get here, this * driver needs work. -* -* FIXME: modify libata to give qc_prep a return value and -* return error here. */ -BUG_ON (tf->command); -break ; +ata_port_err (ap,"%s: unsupported command: %.2x\n" , __func__, + tf->command); +return AC_ERR_INVALID ; }mv_crqb_pack_cmd (cw++, tf->nsect,ATA_REG_NSECT ,0 );mv_crqb_pack_cmd (cw++, tf->hob_lbal,ATA_REG_LBAL ,0 );
@@ -2129,8 +2127,10 @@ static void mv_qc_prep(struct ata_queued_cmd *qc)mv_crqb_pack_cmd (cw++, tf->command,ATA_REG_CMD ,1 );/* last */ if (!(qc->flags &ATA_QCFLAG_DMAMAP )) -return ; +return AC_ERR_OK ;mv_fill_sg (qc); + +return AC_ERR_OK ; }/**
@@ -2145,7 +2145,7 @@ static void mv_qc_prep(struct ata_queued_cmd *qc)* LOCKING: * Inherited from caller. */ -static void mv_qc_prep_iie (struct ata_queued_cmd *qc) +static enum ata_completion_errors mv_qc_prep_iie (struct ata_queued_cmd *qc) {struct ata_port *ap = qc->ap;struct mv_port_priv *pp = ap->private_data;
@@ -2156,9 +2156,9 @@ static void mv_qc_prep_iie(struct ata_queued_cmd *qc)if ((tf->protocol !=ATA_PROT_DMA ) && (tf->protocol !=ATA_PROT_NCQ )) -return ; +return AC_ERR_OK ;if (tf->command ==ATA_CMD_DSM ) -return ;/* use bmdma for this */ +return AC_ERR_OK ;/* use bmdma for this */ /* Fill in Gen IIE command request block */ if (!(tf->flags &ATA_TFLAG_WRITE ))
@@ -2199,8 +2199,10 @@ static void mv_qc_prep_iie(struct ata_queued_cmd *qc) );if (!(qc->flags &ATA_QCFLAG_DMAMAP )) -return ; +return AC_ERR_OK ;mv_fill_sg (qc); + +return AC_ERR_OK ; }/**
drivers/ata/sata_nv.c +11 -7
@@ -313,7 +313,7 @@ static void nv_ck804_freeze(struct ata_port *ap);static void nv_ck804_thaw (struct ata_port *ap);static int nv_adma_slave_config (struct scsi_device *sdev);static int nv_adma_check_atapi_dma (struct ata_queued_cmd *qc); -static void nv_adma_qc_prep (struct ata_queued_cmd *qc); +static enum ata_completion_errors nv_adma_qc_prep (struct ata_queued_cmd *qc);static unsigned int nv_adma_qc_issue (struct ata_queued_cmd *qc);static irqreturn_t nv_adma_interrupt (int irq,void *dev_instance);static void nv_adma_irq_clear (struct ata_port *ap);
@@ -335,7 +335,7 @@ static void nv_mcp55_freeze(struct ata_port *ap);static void nv_swncq_error_handler (struct ata_port *ap);static int nv_swncq_slave_config (struct scsi_device *sdev);static int nv_swncq_port_start (struct ata_port *ap); -static void nv_swncq_qc_prep (struct ata_queued_cmd *qc); +static enum ata_completion_errors nv_swncq_qc_prep (struct ata_queued_cmd *qc);static void nv_swncq_fill_sg (struct ata_queued_cmd *qc);static unsigned int nv_swncq_qc_issue (struct ata_queued_cmd *qc);static void nv_swncq_irq_clear (struct ata_port *ap,u16 fis);
@@ -1382,7 +1382,7 @@ static int nv_adma_use_reg_mode(struct ata_queued_cmd *qc)return 1 ; } -static void nv_adma_qc_prep (struct ata_queued_cmd *qc) +static enum ata_completion_errors nv_adma_qc_prep (struct ata_queued_cmd *qc) {struct nv_adma_port_priv *pp = qc->ap->private_data;struct nv_adma_cpb *cpb = &pp->cpb[qc->tag];
@@ -1394,7 +1394,7 @@ static void nv_adma_qc_prep(struct ata_queued_cmd *qc) (qc->flags & ATA_QCFLAG_DMAMAP));nv_adma_register_mode (qc->ap);ata_bmdma_qc_prep (qc); -return ; +return AC_ERR_OK ; } cpb->resp_flags =NV_CPB_RESP_DONE ;
@@ -1426,6 +1426,8 @@ static void nv_adma_qc_prep(struct ata_queued_cmd *qc) cpb->ctl_flags = ctl_flags;wmb (); cpb->resp_flags =0 ; + +return AC_ERR_OK ; }static unsigned int nv_adma_qc_issue (struct ata_queued_cmd *qc)
@@ -1989,17 +1991,19 @@ static int nv_swncq_port_start(struct ata_port *ap)return 0 ; } -static void nv_swncq_qc_prep (struct ata_queued_cmd *qc) +static enum ata_completion_errors nv_swncq_qc_prep (struct ata_queued_cmd *qc) {if (qc->tf.protocol !=ATA_PROT_NCQ ) {ata_bmdma_qc_prep (qc); -return ; +return AC_ERR_OK ; }if (!(qc->flags &ATA_QCFLAG_DMAMAP )) -return ; +return AC_ERR_OK ;nv_swncq_fill_sg (qc); + +return AC_ERR_OK ; }static void nv_swncq_fill_sg (struct ata_queued_cmd *qc)
drivers/ata/sata_promise.c +4 -2
@@ -155,7 +155,7 @@ static int pdc_sata_scr_write(struct ata_link *link, unsigned int sc_reg, u32 vastatic int pdc_ata_init_one (struct pci_dev *pdev,const struct pci_device_id *ent);static int pdc_common_port_start (struct ata_port *ap);static int pdc_sata_port_start (struct ata_port *ap); -static void pdc_qc_prep (struct ata_queued_cmd *qc); +static enum ata_completion_errors pdc_qc_prep (struct ata_queued_cmd *qc);static void pdc_tf_load_mmio (struct ata_port *ap,const struct ata_taskfile *tf);static void pdc_exec_command_mmio (struct ata_port *ap,const struct ata_taskfile *tf);static int pdc_check_atapi_dma (struct ata_queued_cmd *qc);
@@ -649,7 +649,7 @@ static void pdc_fill_sg(struct ata_queued_cmd *qc) prd[idx -1 ].flags_len |=cpu_to_le32 (ATA_PRD_EOT ); } -static void pdc_qc_prep (struct ata_queued_cmd *qc) +static enum ata_completion_errors pdc_qc_prep (struct ata_queued_cmd *qc) {struct pdc_port_priv *pp = qc->ap->private_data;unsigned int i;
@@ -681,6 +681,8 @@ static void pdc_qc_prep(struct ata_queued_cmd *qc)default :break ; } + +return AC_ERR_OK ; }static int pdc_is_sataii_tx4 (unsigned long flags)
drivers/ata/sata_qstor.c +5 -3
@@ -116,7 +116,7 @@ static int qs_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);static int qs_ata_init_one (struct pci_dev *pdev,const struct pci_device_id *ent);static int qs_port_start (struct ata_port *ap);static void qs_host_stop (struct ata_host *host); -static void qs_qc_prep (struct ata_queued_cmd *qc); +static enum ata_completion_errors qs_qc_prep (struct ata_queued_cmd *qc);static unsigned int qs_qc_issue (struct ata_queued_cmd *qc);static int qs_check_atapi_dma (struct ata_queued_cmd *qc);static void qs_freeze (struct ata_port *ap);
@@ -276,7 +276,7 @@ static unsigned int qs_fill_sg(struct ata_queued_cmd *qc)return si; } -static void qs_qc_prep (struct ata_queued_cmd *qc) +static enum ata_completion_errors qs_qc_prep (struct ata_queued_cmd *qc) {struct qs_port_priv *pp = qc->ap->private_data;u8 dflags =QS_DF_PORD , *buf = pp->pkt;
@@ -288,7 +288,7 @@ static void qs_qc_prep(struct ata_queued_cmd *qc)qs_enter_reg_mode (qc->ap);if (qc->tf.protocol !=ATA_PROT_DMA ) -return ; +return AC_ERR_OK ; nelem =qs_fill_sg (qc);
@@ -311,6 +311,8 @@ static void qs_qc_prep(struct ata_queued_cmd *qc)/* frame information structure (FIS) */ ata_tf_to_fis (&qc->tf,0 ,1 , &buf[32 ]); + +return AC_ERR_OK ; }static inline void qs_packet_start (struct ata_queued_cmd *qc)
drivers/ata/sata_rcar.c +4 -2
@@ -551,12 +551,14 @@ static void sata_rcar_bmdma_fill_sg(struct ata_queued_cmd *qc) prd[si -1 ].addr |=cpu_to_le32 (SATA_RCAR_DTEND ); } -static void sata_rcar_qc_prep (struct ata_queued_cmd *qc) +static enum ata_completion_errors sata_rcar_qc_prep (struct ata_queued_cmd *qc) {if (!(qc->flags &ATA_QCFLAG_DMAMAP )) -return ; +return AC_ERR_OK ;sata_rcar_bmdma_fill_sg (qc); + +return AC_ERR_OK ; }static void sata_rcar_bmdma_setup (struct ata_queued_cmd *qc)
drivers/ata/sata_sil.c +5 -3
@@ -119,7 +119,7 @@ static void sil_dev_config(struct ata_device *dev);static int sil_scr_read (struct ata_link *link,unsigned int sc_reg,u32 *val);static int sil_scr_write (struct ata_link *link,unsigned int sc_reg,u32 val);static int sil_set_mode (struct ata_link *link,struct ata_device **r_failed); -static void sil_qc_prep (struct ata_queued_cmd *qc); +static enum ata_completion_errors sil_qc_prep (struct ata_queued_cmd *qc);static void sil_bmdma_setup (struct ata_queued_cmd *qc);static void sil_bmdma_start (struct ata_queued_cmd *qc);static void sil_bmdma_stop (struct ata_queued_cmd *qc);
@@ -333,12 +333,14 @@ static void sil_fill_sg(struct ata_queued_cmd *qc) last_prd->flags_len |=cpu_to_le32 (ATA_PRD_EOT ); } -static void sil_qc_prep (struct ata_queued_cmd *qc) +static enum ata_completion_errors sil_qc_prep (struct ata_queued_cmd *qc) {if (!(qc->flags &ATA_QCFLAG_DMAMAP )) -return ; +return AC_ERR_OK ;sil_fill_sg (qc); + +return AC_ERR_OK ; }static unsigned char sil_get_device_cache_line (struct pci_dev *pdev)
drivers/ata/sata_sil24.c +4 -2
@@ -336,7 +336,7 @@ static void sil24_dev_config(struct ata_device *dev);static int sil24_scr_read (struct ata_link *link,unsigned sc_reg,u32 *val);static int sil24_scr_write (struct ata_link *link,unsigned sc_reg,u32 val);static int sil24_qc_defer (struct ata_queued_cmd *qc); -static void sil24_qc_prep (struct ata_queued_cmd *qc); +static enum ata_completion_errors sil24_qc_prep (struct ata_queued_cmd *qc);static unsigned int sil24_qc_issue (struct ata_queued_cmd *qc);static bool sil24_qc_fill_rtf (struct ata_queued_cmd *qc);static void sil24_pmp_attach (struct ata_port *ap);
@@ -840,7 +840,7 @@ static int sil24_qc_defer(struct ata_queued_cmd *qc)return ata_std_qc_defer (qc); } -static void sil24_qc_prep (struct ata_queued_cmd *qc) +static enum ata_completion_errors sil24_qc_prep (struct ata_queued_cmd *qc) {struct ata_port *ap = qc->ap;struct sil24_port_priv *pp = ap->private_data;
@@ -884,6 +884,8 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc)if (qc->flags &ATA_QCFLAG_DMAMAP )sil24_fill_sg (qc, sge); + +return AC_ERR_OK ; }static unsigned int sil24_qc_issue (struct ata_queued_cmd *qc)
drivers/ata/sata_sx4.c +4 -2
@@ -218,7 +218,7 @@ static void pdc_error_handler(struct ata_port *ap);static void pdc_freeze (struct ata_port *ap);static void pdc_thaw (struct ata_port *ap);static int pdc_port_start (struct ata_port *ap); -static void pdc20621_qc_prep (struct ata_queued_cmd *qc); +static enum ata_completion_errors pdc20621_qc_prep (struct ata_queued_cmd *qc);static void pdc_tf_load_mmio (struct ata_port *ap,const struct ata_taskfile *tf);static void pdc_exec_command_mmio (struct ata_port *ap,const struct ata_taskfile *tf);static unsigned int pdc20621_dimm_init (struct ata_host *host);
@@ -546,7 +546,7 @@ static void pdc20621_nodata_prep(struct ata_queued_cmd *qc)VPRINTK ("ata pkt buf ofs %u, mmio copied\n" , i); } -static void pdc20621_qc_prep (struct ata_queued_cmd *qc) +static enum ata_completion_errors pdc20621_qc_prep (struct ata_queued_cmd *qc) {switch (qc->tf.protocol) {case ATA_PROT_DMA :
@@ -558,6 +558,8 @@ static void pdc20621_qc_prep(struct ata_queued_cmd *qc)default :break ; } + +return AC_ERR_OK ; } static void __pdc20621_push_hdma(struct ata_queued_cmd *qc,
drivers/atm/eni.c +1 -1
@@ -2243,7 +2243,7 @@ static int eni_init_one(struct pci_dev *pci_dev, rc =dma_set_mask_and_coherent (&pci_dev->dev,DMA_BIT_MASK (32 ));if (rc <0 ) - goto out; + goto err_disable; rc = -ENOMEM ; eni_dev =kmalloc (sizeof (struct eni_dev ),GFP_KERNEL );
drivers/char/tlclk.c +10 -7
@@ -777,17 +777,21 @@ static int __init tlclk_init(void) {int ret; + telclk_interrupt = (inb (TLCLK_REG7 ) &0x0f ); + + alarm_events =kzalloc (sizeof (struct tlclk_alarms ),GFP_KERNEL ); +if (!alarm_events) { + ret = -ENOMEM ; + goto out1; + } + ret =register_chrdev (tlclk_major,"telco_clock" , &tlclk_fops);if (ret <0 ) {printk (KERN_ERR "tlclk: can't get major %d.\n" , tlclk_major); +kfree (alarm_events);return ret; } tlclk_major = ret; - alarm_events =kzalloc (sizeof (struct tlclk_alarms ),GFP_KERNEL ); -if (!alarm_events) { - ret = -ENOMEM ; - goto out1; - }/* Read telecom clock IRQ number (Set by BIOS) */ if (!request_region (TLCLK_BASE ,8 ,"telco_clock" )) {
@@ -796,7 +800,6 @@ static int __init tlclk_init(void) ret = -EBUSY ; goto out2; } - telclk_interrupt = (inb (TLCLK_REG7 ) &0x0f );if (0x0F == telclk_interrupt ) {/* not MCPBL0010 ? */ printk(KERN_ERR "telclk_interrupt = 0x%x non-mcpbl0010 hw.\n",
@@ -837,8 +840,8 @@ static int __init tlclk_init(void)release_region (TLCLK_BASE ,8 ); out2:kfree (alarm_events); -out1:unregister_chrdev (tlclk_major,"telco_clock" ); +out1:return ret; }
drivers/char/tpm/tpm_ibmvtpm.c +9 -0
@@ -550,6 +550,7 @@ static irqreturn_t ibmvtpm_interrupt(int irq, void *vtpm_instance)*/ while ((crq =ibmvtpm_crq_get_next (ibmvtpm)) !=NULL ) {ibmvtpm_crq_process (crq, ibmvtpm); +wake_up_interruptible (&ibmvtpm->crq_queue.wq); crq->valid =0 ;smp_wmb (); }
@@ -596,6 +597,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev, } crq_q->num_entry =CRQ_RES_BUF_SIZE /sizeof (*crq_q->crq_addr); +init_waitqueue_head (&crq_q->wq); ibmvtpm->crq_dma_handle =dma_map_single (dev, crq_q->crq_addr,CRQ_RES_BUF_SIZE ,DMA_BIDIRECTIONAL );
@@ -648,6 +650,13 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,if (rc) goto init_irq_cleanup; +if (!wait_event_timeout (ibmvtpm->crq_queue.wq, + ibmvtpm->rtce_buf !=NULL , +HZ )) { +dev_err (dev,"CRQ response timed out\n" ); + goto init_irq_cleanup; + } +return tpm_chip_register (chip); init_irq_cleanup: do {
drivers/char/tpm/tpm_ibmvtpm.h +1 -0
@@ -31,6 +31,7 @@ struct ibmvtpm_crq_queue {struct ibmvtpm_crq *crq_addr;u32 index;u32 num_entry; +wait_queue_head_t wq; };struct ibmvtpm_dev {
drivers/clk/ti/adpll.c +2 -9
@@ -193,15 +193,8 @@ static const char *ti_adpll_clk_get_name(struct ti_adpll_data *d,if (err)return NULL ; }else { -const char *base_name ="adpll" ; -char *buf; - - buf =devm_kzalloc (d->dev,8 +1 +strlen (base_name) +1 + -strlen (postfix),GFP_KERNEL ); -if (!buf) -return NULL ; -sprintf (buf,"%08lx.%s.%s" , d->pa, base_name, postfix); - name = buf; + name =devm_kasprintf (d->dev,GFP_KERNEL ,"%08lx.adpll.%s" , + d->pa, postfix); }return name;
drivers/clocksource/h8300_timer8.c +1 -1
@@ -176,7 +176,7 @@ static int __init h8300_8timer_init(struct device_node *node)return PTR_ERR (clk); } - ret =ENXIO ; + ret = -ENXIO ; base =of_iomap (node,0 );if (!base) {pr_err ("failed to map registers for clockevent\n" );
drivers/cpufreq/powernv-cpufreq.c +8 -5
@@ -802,6 +802,7 @@ static struct notifier_block powernv_cpufreq_reboot_nb = {void powernv_cpufreq_work_fn (struct work_struct *work) { struct chip *chip = container_of(work, struct chip, throttle); +struct cpufreq_policy *policy;unsigned int cpu;cpumask_t mask;
@@ -816,12 +817,14 @@ void powernv_cpufreq_work_fn(struct work_struct *work) chip->restore = false;for_each_cpu (cpu, &mask) {int index; -struct cpufreq_policy policy; -cpufreq_get_policy (&policy, cpu); - index =cpufreq_table_find_index_c (&policy, policy.cur); -powernv_cpufreq_target_index (&policy, index); -cpumask_andnot (&mask, &mask, policy.cpus); + policy =cpufreq_cpu_get (cpu); +if (!policy) +continue ; + index =cpufreq_table_find_index_c (policy, policy->cur); +powernv_cpufreq_target_index (policy, index); +cpumask_andnot (&mask, &mask, policy->cpus); +cpufreq_cpu_put (policy); } out:put_online_cpus ();
drivers/devfreq/tegra-devfreq.c +3 -1
@@ -79,6 +79,8 @@#define KHZ 1000 +#define KHZ_MAX (ULONG_MAX / KHZ) +/* Assume that the bus is saturated if the utilization is 25% */ #define BUS_SATURATION_RATIO 25
@@ -179,7 +181,7 @@ struct tegra_actmon_emc_ratio { };static struct tegra_actmon_emc_ratio actmon_emc_ratios[] = { - {1400000 ,ULONG_MAX }, + {1400000 ,KHZ_MAX }, {1200000 ,750000 }, {1100000 ,600000 }, {1000000 ,500000 },
drivers/dma/tegra20-apb-dma.c +1 -2
@@ -1208,8 +1208,7 @@ static void tegra_dma_free_chan_resources(struct dma_chan *dc)dev_dbg (tdc2dev (tdc),"Freeing channel %d\n" , tdc->id); -if (tdc->busy) -tegra_dma_terminate_all (dc); +tegra_dma_terminate_all (dc);spin_lock_irqsave (&tdc->lock, flags);list_splice_init (&tdc->pending_sg_req, &sg_req_list);
drivers/dma/xilinx/zynqmp_dma.c +15 -9
@@ -125,10 +125,12 @@/* Max transfer size per descriptor */ #define ZYNQMP_DMA_MAX_TRANS_LEN 0x40000000 +/* Max burst lengths */ +#define ZYNQMP_DMA_MAX_DST_BURST_LEN 32768U +#define ZYNQMP_DMA_MAX_SRC_BURST_LEN 32768U +/* Reset values for data attributes */ #define ZYNQMP_DMA_AXCACHE_VAL 0xF -#define ZYNQMP_DMA_ARLEN_RST_VAL 0xF -#define ZYNQMP_DMA_AWLEN_RST_VAL 0xF#define ZYNQMP_DMA_SRC_ISSUE_RST_VAL 0x1F
@@ -527,17 +529,19 @@ static void zynqmp_dma_handle_ovfl_int(struct zynqmp_dma_chan *chan, u32 status)static void zynqmp_dma_config (struct zynqmp_dma_chan *chan) { -u32 val; +u32 val, burst_val; val =readl (chan->regs +ZYNQMP_DMA_CTRL0 ); val |=ZYNQMP_DMA_POINT_TYPE_SG ;writel (val, chan->regs +ZYNQMP_DMA_CTRL0 ); val =readl (chan->regs +ZYNQMP_DMA_DATA_ATTR ); + burst_val =__ilog2_u32 (chan->src_burst_len); val = (val & ~ZYNQMP_DMA_ARLEN ) | - (chan->src_burst_len <<ZYNQMP_DMA_ARLEN_OFST ); + ((burst_val <<ZYNQMP_DMA_ARLEN_OFST ) &ZYNQMP_DMA_ARLEN ); + burst_val =__ilog2_u32 (chan->dst_burst_len); val = (val & ~ZYNQMP_DMA_AWLEN ) | - (chan->dst_burst_len <<ZYNQMP_DMA_AWLEN_OFST ); + ((burst_val <<ZYNQMP_DMA_AWLEN_OFST ) &ZYNQMP_DMA_AWLEN );writel (val, chan->regs +ZYNQMP_DMA_DATA_ATTR ); }
@@ -551,8 +555,10 @@ static int zynqmp_dma_device_config(struct dma_chan *dchan, {struct zynqmp_dma_chan *chan =to_chan (dchan); - chan->src_burst_len = config->src_maxburst; - chan->dst_burst_len = config->dst_maxburst; + chan->src_burst_len =clamp (config->src_maxburst,1U , +ZYNQMP_DMA_MAX_SRC_BURST_LEN ); + chan->dst_burst_len =clamp (config->dst_maxburst,1U , +ZYNQMP_DMA_MAX_DST_BURST_LEN );return 0 ; }
@@ -968,8 +974,8 @@ static int zynqmp_dma_chan_probe(struct zynqmp_dma_device *zdev,return PTR_ERR (chan->regs); chan->bus_width =ZYNQMP_DMA_BUS_WIDTH_64 ; - chan->dst_burst_len =ZYNQMP_DMA_AWLEN_RST_VAL ; - chan->src_burst_len =ZYNQMP_DMA_ARLEN_RST_VAL ; + chan->dst_burst_len =ZYNQMP_DMA_MAX_DST_BURST_LEN ; + chan->src_burst_len =ZYNQMP_DMA_MAX_SRC_BURST_LEN ; err =of_property_read_u32 (node,"xlnx,bus-width" , &chan->bus_width);if (err <0 ) {dev_err (&pdev->dev,"missing xlnx,bus-width property\n" );
drivers/gpu/drm/amd/amdgpu/atom.c +2 -2
@@ -748,8 +748,8 @@ static void atom_op_jump(atom_exec_context *ctx, int *ptr, int arg) cjiffies = jiffies;if (time_after (cjiffies, ctx->last_jump_jiffies)) { cjiffies -= ctx->last_jump_jiffies; -if ((jiffies_to_msecs (cjiffies) >5000 )) { -DRM_ERROR ("atombios stuck in loop for more than 5secs aborting\n" ); +if ((jiffies_to_msecs (cjiffies) >10000 )) { +DRM_ERROR ("atombios stuck in loop for more than 10secs aborting\n" ); ctx->abort = true; } }else {
drivers/gpu/drm/gma500/cdv_intel_display.c +2 -0
@@ -415,6 +415,8 @@ static bool cdv_intel_find_dp_pll(const struct gma_limit_t *limit,struct gma_crtc *gma_crtc =to_gma_crtc (crtc);struct gma_clock_t clock; +memset (&clock,0 ,sizeof (clock)); +switch (refclk) {case 27000 :if (target <200000 ) {
drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c +3 -1
@@ -194,7 +194,7 @@ static int __init omapdss_boot_init(void) dss =of_find_matching_node (NULL , omapdss_of_match);if (dss ==NULL || !of_device_is_available (dss)) -return 0 ; + goto put_node;omapdss_walk_device (dss, true);
@@ -219,6 +219,8 @@ static int __init omapdss_boot_init(void)kfree (n); } +put_node: +of_node_put (dss);return 0 ; }
drivers/i2c/i2c-core.c +1 -1
@@ -1858,8 +1858,8 @@ static int i2c_register_adapter(struct i2c_adapter *adap)/* create pre-declared device nodes */ of_i2c_register_devices (adap); -i2c_acpi_register_devices (adap);i2c_acpi_install_space_handler (adap); +i2c_acpi_register_devices (adap);if (adap->nr < __i2c_first_dynamic_bus_num)i2c_scan_static_board_info (adap);
drivers/infiniband/core/ucma.c +3 -3
@@ -1296,13 +1296,13 @@ static ssize_t ucma_set_option(struct ucma_file *file, const char __user *inbuf,if (copy_from_user (&cmd, inbuf,sizeof (cmd)))return -EFAULT ; +if (unlikely (cmd.optlen >KMALLOC_MAX_SIZE )) +return -EINVAL ; + ctx =ucma_get_ctx (file, cmd.id);if (IS_ERR (ctx))return PTR_ERR (ctx); -if (unlikely (cmd.optlen >KMALLOC_MAX_SIZE )) -return -EINVAL ; - optval =memdup_user ((void __user *) (unsigned long ) cmd.optval, cmd.optlen);if (IS_ERR (optval)) {
drivers/infiniband/hw/cxgb4/cm.c +2 -2
@@ -3245,7 +3245,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)if (raddr->sin_addr.s_addr ==htonl (INADDR_ANY )) { err =pick_local_ipaddrs (dev, cm_id);if (err) - goto fail2; + goto fail3; }/* find a route */
@@ -3267,7 +3267,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)if (ipv6_addr_type (&raddr6->sin6_addr) ==IPV6_ADDR_ANY ) { err =pick_local_ip6addrs (dev, cm_id);if (err) - goto fail2; + goto fail3; }/* find a route */
drivers/infiniband/hw/i40iw/i40iw_cm.c +1 -1
@@ -2036,9 +2036,9 @@ static int i40iw_addr_resolve_neigh_ipv6(struct i40iw_device *iwdev, dst =i40iw_get_dst_ipv6 (&src_addr, &dst_addr);if (!dst || dst->error) {if (dst) { -dst_release (dst);i40iw_pr_err ("ip6_route_output returned dst->error = %d\n" , dst->error); +dst_release (dst); }return rc; }
drivers/infiniband/sw/rxe/rxe_qp.c +4 -3
@@ -597,15 +597,16 @@ int rxe_qp_from_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask,struct ib_gid_attr sgid_attr;if (mask &IB_QP_MAX_QP_RD_ATOMIC ) { -int max_rd_atomic =__roundup_pow_of_two (attr->max_rd_atomic); +int max_rd_atomic = attr->max_rd_atomic ? +roundup_pow_of_two (attr->max_rd_atomic) :0 ; qp->attr.max_rd_atomic = max_rd_atomic;atomic_set (&qp->req.rd_atomic, max_rd_atomic); }if (mask &IB_QP_MAX_DEST_RD_ATOMIC ) { -int max_dest_rd_atomic = -__roundup_pow_of_two (attr->max_dest_rd_atomic); +int max_dest_rd_atomic = attr->max_dest_rd_atomic ? +roundup_pow_of_two (attr->max_dest_rd_atomic) :0 ; qp->attr.max_dest_rd_atomic = max_dest_rd_atomic;
drivers/md/bcache/bcache.h +1 -0
@@ -547,6 +547,7 @@ struct cache_set {*/ wait_queue_head_t btree_cache_wait;struct task_struct *btree_cache_alloc_lock; +spinlock_t btree_cannibalize_lock;/* * When we free a btree node, we increment the gen of the bucket the
drivers/md/bcache/btree.c +8 -4
@@ -836,15 +836,17 @@ static struct btree *mca_find(struct cache_set *c, struct bkey *k)static int mca_cannibalize_lock (struct cache_set *c,struct btree_op *op) { -struct task_struct *old; - - old =cmpxchg (&c->btree_cache_alloc_lock,NULL , current); -if (old && old != current) { +spin_lock (&c->btree_cannibalize_lock); +if (likely (c->btree_cache_alloc_lock ==NULL )) { + c->btree_cache_alloc_lock = current; + }else if (c->btree_cache_alloc_lock != current) {if (op)prepare_to_wait (&c->btree_cache_wait, &op->wait,TASK_UNINTERRUPTIBLE ); +spin_unlock (&c->btree_cannibalize_lock);return -EINTR ; } +spin_unlock (&c->btree_cannibalize_lock);return 0 ; }
@@ -879,10 +881,12 @@ static struct btree *mca_cannibalize(struct cache_set *c, struct btree_op *op,*/ static void bch_cannibalize_unlock (struct cache_set *c) { +spin_lock (&c->btree_cannibalize_lock);if (c->btree_cache_alloc_lock == current) { c->btree_cache_alloc_lock =NULL ;wake_up (&c->btree_cache_wait); } +spin_unlock (&c->btree_cannibalize_lock); } static struct btree *mca_alloc(struct cache_set *c, struct btree_op *op,
drivers/md/bcache/super.c +1 -0
@@ -1510,6 +1510,7 @@ struct cache_set *bch_cache_set_alloc(struct cache_sb *sb)sema_init (&c->sb_write_mutex,1 );mutex_init (&c->bucket_lock);init_waitqueue_head (&c->btree_cache_wait); +spin_lock_init (&c->btree_cannibalize_lock);init_waitqueue_head (&c->bucket_wait);init_waitqueue_head (&c->gc_wait);sema_init (&c->uuid_write_mutex,1 );
drivers/media/dvb-frontends/tda10071.c +5 -4
@@ -483,10 +483,11 @@ static int tda10071_read_status(struct dvb_frontend *fe, enum fe_status *status) goto error;if (dev->delivery_system ==SYS_DVBS ) { - dev->dvbv3_ber = buf[0 ] <<24 | buf[1 ] <<16 | - buf[2 ] <<8 | buf[3 ] <<0 ; - dev->post_bit_error += buf[0 ] <<24 | buf[1 ] <<16 | - buf[2 ] <<8 | buf[3 ] <<0 ; +u32 bit_error = buf[0 ] <<24 | buf[1 ] <<16 | + buf[2 ] <<8 | buf[3 ] <<0 ; + + dev->dvbv3_ber = bit_error; + dev->post_bit_error += bit_error; c->post_bit_error.stat[0 ].scale =FE_SCALE_COUNTER ; c->post_bit_error.stat[0 ].uvalue = dev->post_bit_error; dev->block_error += buf[4 ] <<8 | buf[5 ] <<0 ;
drivers/media/platform/ti-vpe/cal.c +4 -2
@@ -690,12 +690,13 @@ static void pix_proc_config(struct cal_ctx *ctx) }static void cal_wr_dma_config (struct cal_ctx *ctx, -unsigned int width) +unsigned int width,unsigned int height) {u32 val; val =reg_read (ctx->dev,CAL_WR_DMA_CTRL (ctx->csi2_port));set_field (&val, ctx->csi2_port,CAL_WR_DMA_CTRL_CPORT_MASK ); +set_field (&val, height,CAL_WR_DMA_CTRL_YSIZE_MASK );set_field (&val,CAL_WR_DMA_CTRL_DTAG_PIX_DAT ,CAL_WR_DMA_CTRL_DTAG_MASK ); set_field(&val, CAL_WR_DMA_CTRL_MODE_CONST,
@@ -1321,7 +1322,8 @@ static int cal_start_streaming(struct vb2_queue *vq, unsigned int count)csi2_lane_config (ctx);csi2_ctx_config (ctx);pix_proc_config (ctx); -cal_wr_dma_config (ctx, ctx->v_fmt.fmt.pix.bytesperline); +cal_wr_dma_config (ctx, ctx->v_fmt.fmt.pix.bytesperline, + ctx->v_fmt.fmt.pix.height);cal_wr_dma_addr (ctx, addr);csi2_ppi_enable (ctx);
drivers/media/usb/go7007/go7007-usb.c +3 -1
@@ -1052,6 +1052,7 @@ static int go7007_usb_probe(struct usb_interface *intf,struct go7007_usb *usb;const struct go7007_usb_board *board;struct usb_device *usbdev =interface_to_usbdev (intf); +struct usb_host_endpoint *ep;unsigned num_i2c_devs;char *name;int video_pipe, i, v_urb_len;
@@ -1147,7 +1148,8 @@ static int go7007_usb_probe(struct usb_interface *intf,if (usb->intr_urb->transfer_buffer ==NULL ) goto allocfail; -if (go->board_id ==GO7007_BOARDID_SENSORAY_2250 ) + ep = usb->usbdev->ep_in[4 ]; +if (usb_endpoint_type (&ep->desc) ==USB_ENDPOINT_XFER_BULK ) usb_fill_bulk_urb(usb->intr_urb, usb->usbdev, usb_rcvbulkpipe(usb->usbdev, 4), usb->intr_urb->transfer_buffer, 2*sizeof(u16),
drivers/mfd/mfd-core.c +10 -0
@@ -32,6 +32,11 @@ int mfd_cell_enable(struct platform_device *pdev)const struct mfd_cell *cell =mfd_get_cell (pdev);int err =0 ; +if (!cell->enable) { +dev_dbg (&pdev->dev,"No .enable() call-back registered\n" ); +return 0 ; + } +/* only call enable hook if the cell wasn't previously enabled */ if (atomic_inc_return (cell->usage_count) ==1 ) err = cell->enable (pdev);
@@ -49,6 +54,11 @@ int mfd_cell_disable(struct platform_device *pdev)const struct mfd_cell *cell =mfd_get_cell (pdev);int err =0 ; +if (!cell->disable) { +dev_dbg (&pdev->dev,"No .disable() call-back registered\n" ); +return 0 ; + } +/* only disable if no other clients are using it */ if (atomic_dec_return (cell->usage_count) ==0 ) err = cell->disable (pdev);
drivers/mtd/chips/cfi_cmdset_0002.c +0 -1
@@ -722,7 +722,6 @@ static struct mtd_info *cfi_amdstd_setup(struct mtd_info *mtd)kfree (mtd->eraseregions);kfree (mtd);kfree (cfi->cmdset_priv); -kfree (cfi->cfiq);return NULL ; }
drivers/mtd/cmdlinepart.c +20 -3
@@ -228,12 +228,29 @@ static int mtdpart_setup_real(char *s)struct cmdline_mtd_partition *this_mtd;struct mtd_partition *parts;int mtd_id_len, num_parts; -char *p, *mtd_id; +char *p, *mtd_id, *semicol; + +/* +* Replace the first ';' by a NULL char so strrchr can work +* properly. +*/ + semicol =strchr (s,';' ); +if (semicol) + *semicol ='\0' ; mtd_id = s; -/* fetch <mtd-id> */ - p =strchr (s,':' ); +/* +* fetch <mtd-id>. We use strrchr to ignore all ':' that could +* be present in the MTD name, only the last one is interpreted +* as an <mtd-id>/<part-definition> separator. +*/ + p =strrchr (s,':' ); + +/* Restore the ';' now. */ +if (semicol) + *semicol =';' ; +if (!p) {pr_err ("no mtd-id\n" );return -EINVAL ;
drivers/mtd/nand/omap_elm.c +1 -0
@@ -421,6 +421,7 @@ static int elm_probe(struct platform_device *pdev)pm_runtime_enable (&pdev->dev);if (pm_runtime_get_sync (&pdev->dev) <0 ) { ret = -EINVAL ; +pm_runtime_put_sync (&pdev->dev);pm_runtime_disable (&pdev->dev);dev_err (&pdev->dev,"can't enable clock\n" );return ret;
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +20 -11
@@ -1000,9 +1000,12 @@ static int bnxt_set_pauseparam(struct net_device *dev,if (!BNXT_SINGLE_PF (bp))return -EOPNOTSUPP ; +mutex_lock (&bp->link_lock);if (epause->autoneg) { -if (!(link_info->autoneg &BNXT_AUTONEG_SPEED )) -return -EINVAL ; +if (!(link_info->autoneg &BNXT_AUTONEG_SPEED )) { + rc = -EINVAL ; + goto pause_exit; + } link_info->autoneg |=BNXT_AUTONEG_FLOW_CTRL ;if (bp->hwrm_spec_code >=0x10201 )
@@ -1023,11 +1026,11 @@ static int bnxt_set_pauseparam(struct net_device *dev,if (epause->tx_pause) link_info->req_flow_ctrl |=BNXT_LINK_PAUSE_TX ; -if (netif_running (dev)) { -mutex_lock (&bp->link_lock); +if (netif_running (dev)) rc =bnxt_hwrm_set_pause (bp); -mutex_unlock (&bp->link_lock); - } + +pause_exit: +mutex_unlock (&bp->link_lock);return rc; }
@@ -1671,8 +1674,7 @@ static int bnxt_set_eee(struct net_device *dev, struct ethtool_eee *edata)struct bnxt *bp =netdev_priv (dev);struct ethtool_eee *eee = &bp->eee;struct bnxt_link_info *link_info = &bp->link_info; -u32 advertising = -_bnxt_fw_to_ethtool_adv_spds (link_info->advertising,0 ); +u32 advertising;int rc =0 ;if (!BNXT_SINGLE_PF (bp))
@@ -1681,19 +1683,23 @@ static int bnxt_set_eee(struct net_device *dev, struct ethtool_eee *edata)if (!(bp->flags &BNXT_FLAG_EEE_CAP ))return -EOPNOTSUPP ; +mutex_lock (&bp->link_lock); + advertising =_bnxt_fw_to_ethtool_adv_spds (link_info->advertising,0 );if (!edata->eee_enabled) goto eee_ok;if (!(link_info->autoneg &BNXT_AUTONEG_SPEED )) {netdev_warn (dev,"EEE requires autoneg\n" ); -return -EINVAL ; + rc = -EINVAL ; + goto eee_exit; }if (edata->tx_lpi_enabled) {if (bp->lpi_tmr_hi && (edata->tx_lpi_timer > bp->lpi_tmr_hi || edata->tx_lpi_timer < bp->lpi_tmr_lo)) {netdev_warn (dev,"Valid LPI timer range is %d and %d microsecs\n" , bp->lpi_tmr_lo, bp->lpi_tmr_hi); -return -EINVAL ; + rc = -EINVAL ; + goto eee_exit; }else if (!bp->lpi_tmr_hi) { edata->tx_lpi_timer = eee->tx_lpi_timer; }
@@ -1703,7 +1709,8 @@ static int bnxt_set_eee(struct net_device *dev, struct ethtool_eee *edata) }else if (edata->advertised & ~advertising) {netdev_warn (dev,"EEE advertised %x must be a subset of autoneg advertised speeds %x\n" , edata->advertised, advertising); -return -EINVAL ; + rc = -EINVAL ; + goto eee_exit; } eee->advertised = edata->advertised;
@@ -1715,6 +1722,8 @@ static int bnxt_set_eee(struct net_device *dev, struct ethtool_eee *edata)if (netif_running (dev)) rc =bnxt_hwrm_set_link_setting (bp, false, true); +eee_exit: +mutex_unlock (&bp->link_lock);return rc; }
drivers/net/ethernet/intel/e1000/e1000_main.c +14 -4
@@ -568,8 +568,13 @@ void e1000_reinit_locked(struct e1000_adapter *adapter)WARN_ON (in_interrupt ());while (test_and_set_bit (__E1000_RESETTING, &adapter->flags))msleep (1 ); -e1000_down (adapter); -e1000_up (adapter); + +/* only run the task if not already down */ +if (!test_bit (__E1000_DOWN, &adapter->flags)) { +e1000_down (adapter); +e1000_up (adapter); + } +clear_bit (__E1000_RESETTING, &adapter->flags); }
@@ -1456,10 +1461,15 @@ int e1000_close(struct net_device *netdev)struct e1000_hw *hw = &adapter->hw;int count =E1000_CHECK_RESET_COUNT ; -while (test_bit (__E1000_RESETTING, &adapter->flags) && count--) +while (test_and_set_bit (__E1000_RESETTING, &adapter->flags) && count--)usleep_range (10000 ,20000 ); -WARN_ON (test_bit (__E1000_RESETTING, &adapter->flags)); +WARN_ON (count <0 ); + +/* signal that we're down so that the reset task will no longer run */ +set_bit (__E1000_DOWN, &adapter->flags); +clear_bit (__E1000_RESETTING, &adapter->flags); +e1000_down (adapter);e1000_power_down_phy (adapter);e1000_free_irq (adapter);
drivers/net/ieee802154/adf7242.c +3 -1
@@ -834,7 +834,9 @@ static int adf7242_rx(struct adf7242_local *lp)int ret;u8 lqi, len_u8, *data; -adf7242_read_reg (lp,0 , &len_u8); + ret =adf7242_read_reg (lp,0 , &len_u8); +if (ret) +return ret; len = len_u8;
drivers/net/phy/phy_device.c +2 -1
@@ -1013,7 +1013,8 @@ void phy_detach(struct phy_device *phydev) phydev->attached_dev =NULL ;phy_suspend (phydev); -module_put (phydev->mdio.dev.driver->owner); +if (phydev->mdio.dev.driver) +module_put (phydev->mdio.dev.driver->owner);/* If the device had no specific driver before (i.e. - it * was using the generic driver), we unbind the device
drivers/net/wan/hdlc_ppp.c +11 -5
@@ -386,11 +386,8 @@ static void ppp_cp_parse_cr(struct net_device *dev, u16 pid, u8 id, }for (opt = data; len; len -= opt[1 ], opt += opt[1 ]) { -if (len <2 || len < opt[1 ]) { - dev->stats.rx_errors++; -kfree (out); -return ;/* bad packet, drop silently */ - } +if (len <2 || opt[1 ] <2 || len < opt[1 ]) + goto err_out;if (pid ==PID_LCP )switch (opt[0 ]) {
@@ -398,6 +395,8 @@ static void ppp_cp_parse_cr(struct net_device *dev, u16 pid, u8 id,continue ;/* MRU always OK and > 1500 bytes? */ case LCP_OPTION_ACCM :/* async control character map */ +if (opt[1 ] <sizeof (valid_accm)) + goto err_out;if (!memcmp (opt, valid_accm,sizeof (valid_accm)))continue ;
@@ -409,6 +408,8 @@ static void ppp_cp_parse_cr(struct net_device *dev, u16 pid, u8 id, }break ;case LCP_OPTION_MAGIC : +if (len <6 ) + goto err_out;if (opt[1 ] !=6 || (!opt[2 ] && !opt[3 ] && !opt[4 ] && !opt[5 ]))break ;/* reject invalid magic number */
@@ -427,6 +428,11 @@ static void ppp_cp_parse_cr(struct net_device *dev, u16 pid, u8 id,ppp_cp_event (dev, pid,RCR_GOOD ,CP_CONF_ACK , id, req_len, data);kfree (out); +return ; + +err_out: + dev->stats.rx_errors++; +kfree (out); }static int ppp_rx (struct sk_buff *skb)
drivers/net/wireless/ath/ar5523/ar5523.c +2 -0
@@ -1769,6 +1769,8 @@ static struct usb_device_id ar5523_id_table[] = {AR5523_DEVICE_UX (0x0846 ,0x4300 ),/* Netgear / WG111U */ AR5523_DEVICE_UG (0x0846 ,0x4250 ),/* Netgear / WG111T */ AR5523_DEVICE_UG (0x0846 ,0x5f00 ),/* Netgear / WPN111 */ +AR5523_DEVICE_UG (0x083a ,0x4506 ),/* SMC / EZ Connect +SMCWUSBT-G2 */ AR5523_DEVICE_UG (0x157e ,0x3006 ),/* Umedia / AR5523_1 */ AR5523_DEVICE_UX (0x157e ,0x3205 ),/* Umedia / AR5523_2 */ AR5523_DEVICE_UG(0x157e, 0x3006), /* Umedia / TEW444UBEU */
drivers/net/wireless/marvell/mwifiex/fw.h +1 -1
@@ -921,7 +921,7 @@ struct mwifiex_tkip_param {struct mwifiex_aes_param {u8 pn[WPA_PN_SIZE ];__le16 key_len; -u8 key[WLAN_KEY_LEN_CCMP ]; +u8 key[WLAN_KEY_LEN_CCMP_256 ]; } __packed;struct mwifiex_wapi_param {
drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c +2 -2
@@ -625,7 +625,7 @@ static int mwifiex_ret_802_11_key_material_v2(struct mwifiex_private *priv, key_v2 = &resp->params.key_material_v2; len =le16_to_cpu (key_v2->key_param_set.key_params.aes.key_len); -if (len >WLAN_KEY_LEN_CCMP ) +if (len >sizeof (key_v2->key_param_set.key_params.aes.key))return -EINVAL ;if (le16_to_cpu (key_v2->action) == HostCmd_ACT_GEN_SET) {
@@ -641,7 +641,7 @@ static int mwifiex_ret_802_11_key_material_v2(struct mwifiex_private *priv,return 0 ;memset (priv->aes_key_v2.key_param_set.key_params.aes.key,0 , -WLAN_KEY_LEN_CCMP ); +sizeof (key_v2->key_param_set.key_params.aes.key)); priv->aes_key_v2.key_param_set.key_params.aes.key_len =cpu_to_le16 (len); memcpy(priv->aes_key_v2.key_param_set.key_params.aes.key,
drivers/phy/phy-s5pv210-usb2.c +4 -0
@@ -142,6 +142,10 @@ static void s5pv210_phy_pwr(struct samsung_usb2_phy_instance *inst, bool on)udelay (10 ); rst &= ~rstbits;writel (rst, drv->reg_phy +S5PV210_UPHYRST ); +/* The following delay is necessary for the reset sequence to be +* completed +*/ +udelay (80 ); }else { pwr =readl (drv->reg_phy +S5PV210_UPHYPWR ); pwr |= phypwr;
drivers/scsi/aacraid/aachba.c +4 -4
@@ -1929,13 +1929,13 @@ static int aac_read(struct scsi_cmnd * scsicmd) scsicmd->result =DID_OK <<16 |COMMAND_COMPLETE <<8 |SAM_STAT_CHECK_CONDITION ;set_sense (&dev->fsa_dev[cid].sense_data, -HARDWARE_ERROR ,SENCODE_INTERNAL_TARGET_FAILURE , +ILLEGAL_REQUEST ,SENCODE_LBA_OUT_OF_RANGE ,ASENCODE_INTERNAL_TARGET_FAILURE ,0 ,0 );memcpy (scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data,min_t (size_t,sizeof (dev->fsa_dev[cid].sense_data),SCSI_SENSE_BUFFERSIZE )); scsicmd->scsi_done (scsicmd); -return 1 ; +return 0 ; } dprintk((KERN_DEBUG "aac_read[cpu %d]: lba = %llu, t = %ld.\n",
@@ -2023,13 +2023,13 @@ static int aac_write(struct scsi_cmnd * scsicmd) scsicmd->result =DID_OK <<16 |COMMAND_COMPLETE <<8 |SAM_STAT_CHECK_CONDITION ;set_sense (&dev->fsa_dev[cid].sense_data, -HARDWARE_ERROR ,SENCODE_INTERNAL_TARGET_FAILURE , +ILLEGAL_REQUEST ,SENCODE_LBA_OUT_OF_RANGE ,ASENCODE_INTERNAL_TARGET_FAILURE ,0 ,0 );memcpy (scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data,min_t (size_t,sizeof (dev->fsa_dev[cid].sense_data),SCSI_SENSE_BUFFERSIZE )); scsicmd->scsi_done (scsicmd); -return 1 ; +return 0 ; } dprintk((KERN_DEBUG "aac_write[cpu %d]: lba = %llu, t = %ld.\n",
drivers/scsi/lpfc/lpfc_ct.c +69 -68
389 lines not on this page · raw message
drivers/scsi/lpfc/lpfc_hw.h +16 -20
@@ -1289,25 +1289,8 @@ struct fc_rdp_res_frame {/* lpfc_sli_ct_request defines the CT_IU preamble for FDMI commands */ #define SLI_CT_FDMI_Subtypes 0x10/* Management Service Subtype */ -/* -* Registered Port List Format -*/ -struct lpfc_fdmi_reg_port_list { -uint32_t EntryCnt; -uint32_t pe;/* Variable-length array */ -}; - -/* Definitions for HBA / Port attribute entries */ -struct lpfc_fdmi_attr_def {/* Defined in TLV format */ -/* Structure is in Big Endian format */ -uint32_t AttrType:16 ; -uint32_t AttrLen:16 ; -uint32_t AttrValue;/* Marks start of Value (ATTRIBUTE_ENTRY) */ -}; - -/* Attribute Entry */ struct lpfc_fdmi_attr_entry { union {
@@ -1318,7 +1301,13 @@ struct lpfc_fdmi_attr_entry { } un; }; -#define LPFC_FDMI_MAX_AE_SIZE sizeof(struct lpfc_fdmi_attr_entry) +struct lpfc_fdmi_attr_def {/* Defined in TLV format */ +/* Structure is in Big Endian format */ +uint32_t AttrType:16 ; +uint32_t AttrLen:16 ; +/* Marks start of Value (ATTRIBUTE_ENTRY) */ +struct lpfc_fdmi_attr_entry AttrValue; +} __packed;/* * HBA Attribute Block
@@ -1342,13 +1331,20 @@ struct lpfc_fdmi_hba_ident {struct lpfc_name PortName; }; +/* +* Registered Port List Format +*/ +struct lpfc_fdmi_reg_port_list { +uint32_t EntryCnt; +struct lpfc_fdmi_port_entry pe; +} __packed; +/* * Register HBA(RHBA) */ struct lpfc_fdmi_reg_hba {struct lpfc_fdmi_hba_ident hi; -struct lpfc_fdmi_reg_port_list rpl;/* variable-length array */ -/* struct lpfc_fdmi_attr_block ab; */ +struct lpfc_fdmi_reg_port_list rpl; };/*
drivers/scsi/lpfc/lpfc_sli.c +4 -0
@@ -15648,6 +15648,10 @@ lpfc_prep_seq(struct lpfc_vport *vport, struct hbq_dmabuf *seq_dmabuf)list_add_tail (&iocbq->list, &first_iocbq->list); } } +/* Free the sequence's header buffer */ +if (!first_iocbq) +lpfc_in_buf_free (vport->phba, &seq_dmabuf->dbuf); +return first_iocbq; }
drivers/tty/serial/8250/8250_core.c +9 -2
@@ -1046,8 +1046,10 @@ int serial8250_register_8250_port(struct uart_8250_port *up) ret =uart_add_one_port (&serial8250_reg, &uart->port); -if (ret ==0 ) - ret = uart->port.line; +if (ret) + goto err; + + ret = uart->port.line; }else { dev_info(uart->port.dev, "skipping CIR port at 0x%lx / 0x%llx, IRQ %d\n",
@@ -1061,6 +1063,11 @@ int serial8250_register_8250_port(struct uart_8250_port *up)mutex_unlock (&serial_mutex);return ret; + +err: + uart->port.dev =NULL ; +mutex_unlock (&serial_mutex); +return ret; }EXPORT_SYMBOL (serial8250_register_8250_port);
drivers/tty/serial/8250/8250_omap.c +5 -3
@@ -773,7 +773,10 @@ static void __dma_rx_do_complete(struct uart_8250_port *p)dmaengine_tx_status (dma->rxchan, dma->rx_cookie, &state); count = dma->rx_size - state.residue; - +if (count < dma->rx_size) +dmaengine_terminate_async (dma->rxchan); +if (!count) + goto unlock; ret =tty_insert_flip_string (tty_port, dma->rx_buf, count); p->port.icount.rx += ret;
@@ -811,7 +814,6 @@ static void omap_8250_rx_dma_flush(struct uart_8250_port *p)spin_unlock_irqrestore (&priv->rx_dma_lock, flags);__dma_rx_do_complete (p); -dmaengine_terminate_all (dma->rxchan); }static int omap_8250_rx_dma (struct uart_8250_port *p)
@@ -1194,11 +1196,11 @@ static int omap8250_probe(struct platform_device *pdev)spin_lock_init (&priv->rx_dma_lock);device_init_wakeup (&pdev->dev, true); +pm_runtime_enable (&pdev->dev);pm_runtime_use_autosuspend (&pdev->dev);pm_runtime_set_autosuspend_delay (&pdev->dev,-1 );pm_runtime_irq_safe (&pdev->dev); -pm_runtime_enable (&pdev->dev);pm_runtime_get_sync (&pdev->dev);
drivers/tty/serial/8250/8250_port.c +15 -1
@@ -1806,6 +1806,7 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir)unsigned char status;unsigned long flags;struct uart_8250_port *up =up_to_u8250p (port); +bool skip_rx = false;if (iir &UART_IIR_NO_INT )return 0 ;
@@ -1814,7 +1815,20 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir) status =serial_port_in (port,UART_LSR ); -if (status & (UART_LSR_DR |UART_LSR_BI )) { +/* +* If port is stopped and there are no error conditions in the +* FIFO, then don't drain the FIFO, as this may lead to TTY buffer +* overflow. Not servicing, RX FIFO would trigger auto HW flow +* control when FIFO occupancy reaches preset threshold, thus +* halting RX. This only works when auto HW flow control is +* available. +*/ +if (!(status & (UART_LSR_FIFOE |UART_LSR_BRK_ERROR_BITS )) && + (port->status & (UPSTAT_AUTOCTS |UPSTAT_AUTORTS )) && + !(port->read_status_mask &UART_LSR_DR )) + skip_rx = true; + +if (status & (UART_LSR_DR |UART_LSR_BI ) && !skip_rx) {if (!up->dma ||handle_rx_dma (up, iir)) status =serial8250_rx_chars (up, status); }
drivers/tty/serial/samsung.c +4 -4
@@ -1157,14 +1157,14 @@ static unsigned int s3c24xx_serial_getclk(struct s3c24xx_uart_port *ourport,struct s3c24xx_uart_info *info = ourport->info;struct clk *clk;unsigned long rate; -unsigned int cnt, baud, quot, clk_sel, best_quot =0 ; +unsigned int cnt, baud, quot, best_quot =0 ;char clkname[MAX_CLK_NAME_LENGTH ];int calc_deviation, deviation = (1 <<30 ) -1 ; - clk_sel = (ourport->cfg->clk_sel) ? ourport->cfg->clk_sel : - ourport->info->def_clk_sel;for (cnt =0 ; cnt < info->num_clks; cnt++) { -if (!(clk_sel & (1 << cnt))) +/* Keep selected clock if provided */ +if (ourport->cfg->clk_sel && + !(ourport->cfg->clk_sel & (1 << cnt)))continue ;sprintf (clkname,"clk_uart_baud%d" , cnt);
drivers/usb/host/ehci-mv.c +3 -5
@@ -196,12 +196,10 @@ static int mv_ehci_probe(struct platform_device *pdev) hcd->rsrc_len =resource_size (r); hcd->regs = ehci_mv->op_regs; - hcd->irq =platform_get_irq (pdev,0 ); -if (!hcd->irq) { -dev_err (&pdev->dev,"Cannot get irq." ); - retval = -ENODEV ; + retval =platform_get_irq (pdev,0 ); +if (retval <0 ) goto err_disable_clk; - } + hcd->irq = retval; ehci =hcd_to_ehci (hcd); ehci->caps = (struct ehci_caps *) ehci_mv->cap_regs;
drivers/vfio/pci/vfio_pci.c +13 -0
@@ -392,6 +392,19 @@ static void vfio_pci_release(void *device_data)if (!(--vdev->refcnt)) {vfio_spapr_pci_eeh_release (vdev->pdev);vfio_pci_disable (vdev); +mutex_lock (&vdev->igate); +if (vdev->err_trigger) { +eventfd_ctx_put (vdev->err_trigger); + vdev->err_trigger =NULL ; + } +mutex_unlock (&vdev->igate); + +mutex_lock (&vdev->igate); +if (vdev->req_trigger) { +eventfd_ctx_put (vdev->req_trigger); + vdev->req_trigger =NULL ; + } +mutex_unlock (&vdev->igate); }mutex_unlock (&driver_lock);
fs/block_dev.c +10 -0
@@ -1586,6 +1586,16 @@ static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part)struct gendisk *disk = bdev->bd_disk;struct block_device *victim =NULL ; +/* +* Sync early if it looks like we're the last one. If someone else +* opens the block device between now and the decrement of bd_openers +* then we did a sync that we didn't need to, but that's not the end +* of the world and we want to avoid long (could be several minute) +* syncs while holding the mutex. +*/ +if (bdev->bd_openers ==1 ) +sync_blockdev (bdev); +mutex_lock_nested (&bdev->bd_mutex, for_part);if (for_part) bdev->bd_part_count--;
fs/btrfs/extent-tree.c +0 -2
@@ -9435,8 +9435,6 @@ int btrfs_drop_snapshot(struct btrfs_root *root,*/ if (!for_reloc && root_dropped == false)btrfs_add_dead_root (root); -if (err && err != -EAGAIN ) -btrfs_handle_fs_error (fs_info, err,NULL );return err; }
fs/ceph/caps.c +13 -1
@@ -1807,12 +1807,24 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags,if (mutex_trylock (&session->s_mutex) ==0 ) {dout ("inverting session/ino locks on %p\n" , session); + session =ceph_get_mds_session (session);spin_unlock (&ci->i_ceph_lock);if (took_snap_rwsem) {up_read (&mdsc->snap_rwsem); took_snap_rwsem =0 ; } -mutex_lock (&session->s_mutex); +if (session) { +mutex_lock (&session->s_mutex); +ceph_put_mds_session (session); + }else { +/* +* Because we take the reference while +* holding the i_ceph_lock, it should +* never be NULL. Throw a warning if it +* ever is. +*/ +WARN_ON_ONCE (true); + } goto retry; } }
fs/cifs/cifsglob.h +6 -3
@@ -242,8 +242,9 @@ struct smb_version_operations {int (*check_message)(char *,unsigned int ,struct TCP_Server_Info *);bool (*is_oplock_break)(char *,struct TCP_Server_Info *);int (*handle_cancelled_mid)(char *,struct TCP_Server_Info *); -void (*downgrade_oplock)(struct TCP_Server_Info *, -struct cifsInodeInfo *,bool ); +void (*downgrade_oplock)(struct TCP_Server_Info *server, +struct cifsInodeInfo *cinode,__u32 oplock, +unsigned int epoch,bool *purge_cache);/* process transaction2 response */ bool (*check_trans2)(struct mid_q_entry *,struct TCP_Server_Info *,char *,int );
@@ -1080,6 +1081,8 @@ struct cifsFileInfo {unsigned int f_flags; bool invalidHandle:1; /* file closed via session abend */ bool oplock_break_cancelled:1; +unsigned int oplock_epoch;/* epoch from the lease break */ +__u32 oplock_level;/* oplock/lease level from the lease break */ int count;spinlock_t file_info_lock;/* protects four flag/count fields above */ struct mutex fh_mutex;/* prevents reopen race after dead ses*/
@@ -1191,7 +1194,7 @@ struct cifsInodeInfo {unsigned int epoch;/* used to track lease state changes */ #define CIFS_INODE_PENDING_OPLOCK_BREAK (0)/* oplock break in progress */ #define CIFS_INODE_PENDING_WRITERS (1)/* Writes in progress */ -#define CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2 (2)/* Downgrade oplock to L2 */ +#define CIFS_INODE_FLAG_UNUSED (2)/* Unused flag */ #define CIFS_INO_DELETE_PENDING (3)/* delete pending on server */ #define CIFS_INO_INVALID_MAPPING (4)/* pagecache is invalid */ #define CIFS_INO_LOCK (5)/* lock bit for synchronization */
fs/cifs/file.c +14 -7
@@ -3531,7 +3531,8 @@ readpages_get_pages(struct address_space *mapping, struct list_head *page_list,break ;__SetPageLocked (page); -if (add_to_page_cache_locked (page, mapping, page->index, gfp)) { + rc =add_to_page_cache_locked (page, mapping, page->index, gfp); +if (rc) {__ClearPageLocked (page);break ; }
@@ -3547,6 +3548,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, struct list_head *page_list, unsigned num_pages) { int rc; +int err =0 ;struct list_head tmplist;struct cifsFileInfo *open_file = file->private_data;struct cifs_sb_info *cifs_sb =CIFS_FILE_SB (file);
@@ -3587,7 +3589,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,* the order of declining indexes. When we put the pages in * the rdata->pages, then we want them in increasing order. */ -while (!list_empty (page_list)) { +while (!list_empty (page_list) && !err) {unsigned int i, nr_pages, bytes, rsize;loff_t offset;struct page *page, *tpage;
@@ -3610,9 +3612,10 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,return 0 ; } - rc =readpages_get_pages (mapping, page_list, rsize, &tmplist, + nr_pages =0 ; + err =readpages_get_pages (mapping, page_list, rsize, &tmplist, &nr_pages, &offset, &bytes); -if (rc) { +if (!nr_pages) {add_credits_and_wake_if (server, credits,0 );break ; }
@@ -3912,12 +3915,13 @@ void cifs_oplock_break(struct work_struct *work)struct cifs_tcon *tcon =tlink_tcon (cfile->tlink);struct TCP_Server_Info *server = tcon->ses->server;int rc =0 ; +bool purge_cache = false;wait_on_bit (&cinode->flags,CIFS_INODE_PENDING_WRITERS ,TASK_UNINTERRUPTIBLE ); - server->ops->downgrade_oplock (server, cinode, -test_bit (CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2 , &cinode->flags)); + server->ops->downgrade_oplock (server, cinode, cfile->oplock_level, + cfile->oplock_epoch, &purge_cache);if (!CIFS_CACHE_WRITE (cinode) &&CIFS_CACHE_READ (cinode) &&cifs_has_mand_locks (cinode)) {
@@ -3932,18 +3936,21 @@ void cifs_oplock_break(struct work_struct *work)else break_lease (inode,O_WRONLY ); rc =filemap_fdatawrite (inode->i_mapping); -if (!CIFS_CACHE_READ (cinode)) { +if (!CIFS_CACHE_READ (cinode) || purge_cache) { rc =filemap_fdatawait (inode->i_mapping);mapping_set_error (inode->i_mapping, rc);cifs_zap_mapping (inode); }cifs_dbg (FYI ,"Oplock flush inode %p rc %d\n" , inode, rc); +if (CIFS_CACHE_WRITE (cinode)) + goto oplock_break_ack; } rc =cifs_push_locks (cfile);if (rc)cifs_dbg (VFS ,"Push locks rc = %d\n" , rc); +oplock_break_ack:/* * releasing stale oplock after recent reconnect of smb session using * a now incorrect file handle is not a data integrity issue but do
fs/cifs/misc.c +3 -14
@@ -481,21 +481,10 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)set_bit (CIFS_INODE_PENDING_OPLOCK_BREAK , &pCifsInode->flags); -/* -* Set flag if the server downgrades the oplock -* to L2 else clear. -*/ -if (pSMB->OplockLevel) -set_bit ( -CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2 , - &pCifsInode->flags); -else -clear_bit ( -CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2 , - &pCifsInode->flags); - -cifs_queue_oplock_break (netfile); + netfile->oplock_epoch =0 ; + netfile->oplock_level = pSMB->OplockLevel; netfile->oplock_break_cancelled = false; +cifs_queue_oplock_break (netfile);spin_unlock (&tcon->open_file_lock);spin_unlock (&cifs_tcp_ses_lock);
fs/cifs/smb1ops.c +3 -5
@@ -378,12 +378,10 @@ coalesce_t2(char *second_buf, struct smb_hdr *target_hdr)static void cifs_downgrade_oplock (struct TCP_Server_Info *server, -struct cifsInodeInfo *cinode,bool set_level2) +struct cifsInodeInfo *cinode,__u32 oplock, +unsigned int epoch,bool *purge_cache) { -if (set_level2) -cifs_set_oplock_level (cinode,OPLOCK_READ ); -else -cifs_set_oplock_level (cinode,0 ); +cifs_set_oplock_level (cinode, oplock); } static bool
fs/cifs/smb2misc.c +7 -25
@@ -491,7 +491,7 @@ smb2_tcon_has_lease(struct cifs_tcon *tcon, struct smb2_lease_break *rsp,cifs_dbg (FYI ,"found in the open list\n" );cifs_dbg (FYI ,"lease key match, lease break 0x%x\n" , -le32_to_cpu (rsp->NewLeaseState)); + lease_state);if (ack_req) cfile->oplock_break_cancelled = false;
@@ -500,17 +500,8 @@ smb2_tcon_has_lease(struct cifs_tcon *tcon, struct smb2_lease_break *rsp,set_bit (CIFS_INODE_PENDING_OPLOCK_BREAK , &cinode->flags); -/* -* Set or clear flags depending on the lease state being READ. -* HANDLE caching flag should be added when the client starts -* to defer closing remote file handles with HANDLE leases. -*/ -if (lease_state &SMB2_LEASE_READ_CACHING_HE ) -set_bit (CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2 , - &cinode->flags); -else -clear_bit (CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2 , - &cinode->flags); + cfile->oplock_epoch =le16_to_cpu (rsp->Epoch); + cfile->oplock_level = lease_state;cifs_queue_oplock_break (cfile);kfree (lw);
@@ -533,7 +524,7 @@ smb2_tcon_has_lease(struct cifs_tcon *tcon, struct smb2_lease_break *rsp,cifs_dbg (FYI ,"found in the pending open list\n" );cifs_dbg (FYI ,"lease key match, lease break 0x%x\n" , -le32_to_cpu (rsp->NewLeaseState)); + lease_state); open->oplock = lease_state; }
@@ -645,18 +636,9 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)set_bit (CIFS_INODE_PENDING_OPLOCK_BREAK , &cinode->flags); -/* -* Set flag if the server downgrades the oplock -* to L2 else clear. -*/ -if (rsp->OplockLevel) -set_bit ( -CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2 , - &cinode->flags); -else -clear_bit ( -CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2 , - &cinode->flags); + cfile->oplock_epoch =0 ; + cfile->oplock_level = rsp->OplockLevel; +spin_unlock (&cfile->file_info_lock);cifs_queue_oplock_break (cfile);
fs/cifs/smb2ops.c +30 -14
73 lines not on this page · raw message
fs/cifs/smb2pdu.h +1 -1
@@ -1025,7 +1025,7 @@ struct smb2_oplock_break {struct smb2_lease_break {struct smb2_hdr hdr;__le16 StructureSize;/* Must be 44 */ -__le16 Reserved; +__le16 Epoch;__le32 Flags;__u8 LeaseKey[16 ];__le32 CurrentLeaseState;
fs/fuse/dev.c +0 -1
@@ -825,7 +825,6 @@ static int fuse_check_page(struct page *page) { if (page_mapcount(page) || page->mapping != NULL || - page_count(page) != 1 || (page->flags & PAGE_FLAGS_CHECK_AT_PREP & ~(1 << PG_locked | 1 << PG_referenced |
fs/ubifs/io.c +14 -2
@@ -237,7 +237,7 @@ int ubifs_is_mapped(const struct ubifs_info *c, int lnum)int ubifs_check_node (const struct ubifs_info *c,const void *buf,int lnum,int offs,int quiet,int must_chk_crc) { -int err = -EINVAL , type, node_len; +int err = -EINVAL , type, node_len, dump_node =1 ;uint32_t crc, node_crc, magic;const struct ubifs_ch *ch = buf;
@@ -290,10 +290,22 @@ int ubifs_check_node(const struct ubifs_info *c, const void *buf, int lnum, out_len:if (!quiet)ubifs_err (c,"bad node length %d" , node_len); +if (type ==UBIFS_DATA_NODE && node_len >UBIFS_DATA_NODE_SZ ) + dump_node =0 ; out:if (!quiet) {ubifs_err (c,"bad node at LEB %d:%d" , lnum, offs); -ubifs_dump_node (c, buf); +if (dump_node) { +ubifs_dump_node (c, buf); + }else { +int safe_len =min3 (node_len, c->leb_size - offs, + (int )UBIFS_MAX_DATA_NODE_SZ ); +pr_err ("\tprevent out-of-bounds memory access\n" ); +pr_err ("\ttruncated data node length %d\n" , safe_len); +pr_err ("\tcorrupted data node:\n" ); +print_hex_dump (KERN_ERR ,"\t" ,DUMP_PREFIX_OFFSET ,32 ,1 , + buf, safe_len,0 ); + }dump_stack (); }return err;
fs/xfs/libxfs/xfs_attr_leaf.c +3 -1
@@ -1332,7 +1332,9 @@ xfs_attr3_leaf_add_work(for (i =0 ; i <XFS_ATTR_LEAF_MAPSIZE ; i++) {if (ichdr->freemap[i].base == tmp) { ichdr->freemap[i].base +=sizeof (xfs_attr_leaf_entry_t); - ichdr->freemap[i].size -=sizeof (xfs_attr_leaf_entry_t); + ichdr->freemap[i].size -= +min_t (uint16_t, ichdr->freemap[i].size, +sizeof (xfs_attr_leaf_entry_t)); } } ichdr->usedbytes +=xfs_attr_leaf_entsize (leaf, args->index);
fs/xfs/libxfs/xfs_dir2_node.c +1 -0
@@ -212,6 +212,7 @@ __xfs_dir3_free_read(xfs_buf_ioerror (*bpp, -EFSCORRUPTED );xfs_verifier_error (*bpp);xfs_trans_brelse (tp, *bpp); + *bpp =NULL ;return -EFSCORRUPTED ; }
include/linux/debugfs.h +3 -2
@@ -77,6 +77,8 @@ static const struct file_operations __fops = { \ .llseek = generic_file_llseek, \ } +typedef struct vfsmount *(*debugfs_automount_t )(struct dentry *,void *); +#if defined(CONFIG_DEBUG_FS ) struct dentry *debugfs_create_file(const char *name, umode_t mode,
@@ -96,7 +98,6 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);struct dentry *debugfs_create_symlink (const char *name,struct dentry *parent,const char *dest); -typedef struct vfsmount *(*debugfs_automount_t )(struct dentry *,void *); struct dentry *debugfs_create_automount(const char *name, struct dentry *parent, debugfs_automount_t f,
@@ -211,7 +212,7 @@ static inline struct dentry *debugfs_create_symlink(const char *name,static inline struct dentry *debugfs_create_automount (const char *name,struct dentry *parent, -struct vfsmount *(*f)(void *), +debugfs_automount_t f,void *data) {return ERR_PTR (-ENODEV );
include/linux/libata.h +7 -6
@@ -499,6 +499,7 @@ enum hsm_task_states { };enum ata_completion_errors { +AC_ERR_OK =0 ,/* no error */ AC_ERR_DEV = (1 <<0 ),/* device reported error */ AC_ERR_HSM = (1 <<1 ),/* host state machine violation */ AC_ERR_TIMEOUT = (1 <<2 ),/* timeout */
@@ -903,9 +904,9 @@ struct ata_port_operations {/* * Command execution */ -int (*qc_defer)(struct ata_queued_cmd *qc); -int (*check_atapi_dma)(struct ata_queued_cmd *qc); -void (*qc_prep)(struct ata_queued_cmd *qc); +int (*qc_defer)(struct ata_queued_cmd *qc); +int (*check_atapi_dma)(struct ata_queued_cmd *qc); +enum ata_completion_errors (*qc_prep)(struct ata_queued_cmd *qc);unsigned int (*qc_issue)(struct ata_queued_cmd *qc);bool (*qc_fill_rtf)(struct ata_queued_cmd *qc);
@@ -1168,7 +1169,7 @@ extern int ata_xfer_mode2shift(unsigned long xfer_mode);extern const char *ata_mode_string (unsigned long xfer_mask);extern unsigned long ata_id_xfermask (const u16 *id);extern int ata_std_qc_defer (struct ata_queued_cmd *qc); -extern void ata_noop_qc_prep (struct ata_queued_cmd *qc); +extern enum ata_completion_errors ata_noop_qc_prep (struct ata_queued_cmd *qc);extern void ata_sg_init (struct ata_queued_cmd *qc,struct scatterlist *sg,unsigned int n_elem);extern unsigned int ata_dev_classify (const struct ata_taskfile *tf);
@@ -1881,9 +1882,9 @@ extern const struct ata_port_operations ata_bmdma_port_ops; .sg_tablesize = LIBATA_MAX_PRD, \ .dma_boundary = ATA_DMA_BOUNDARY -extern void ata_bmdma_qc_prep(struct ata_queued_cmd *qc); +extern enum ata_completion_errors ata_bmdma_qc_prep(struct ata_queued_cmd *qc);extern unsigned int ata_bmdma_qc_issue (struct ata_queued_cmd *qc); -extern void ata_bmdma_dumb_qc_prep (struct ata_queued_cmd *qc); +extern enum ata_completion_errors ata_bmdma_dumb_qc_prep (struct ata_queued_cmd *qc);extern unsigned int ata_bmdma_port_intr (struct ata_port *ap,struct ata_queued_cmd *qc);extern irqreturn_t ata_bmdma_interrupt (int irq,void *dev_instance);
include/linux/mtd/map.h +1 -1
@@ -312,7 +312,7 @@ void map_destroy(struct mtd_info *mtd); ({ \ int i, ret = 1; \ for (i = 0; i < map_words(map); i++) { \ - if (((val1).x[i] & (val2).x[i]) != (val2).x[i]) { \ + if (((val1).x[i] & (val2).x[i]) != (val3).x[i]) { \ ret = 0; \ break; \ } \
include/linux/seqlock.h +9 -2
@@ -242,6 +242,13 @@ static inline void raw_write_seqcount_end(seqcount_t *s)* usual consistency guarantee. It is one wmb cheaper, because we can * collapse the two back-to-back wmb()s. * +* Note that, writes surrounding the barrier should be declared atomic (e.g. +* via WRITE_ONCE): a) to ensure the writes become visible to other threads +* atomically, avoiding compiler optimizations; b) to document which writes are +* meant to propagate to the reader critical section. This is necessary because +* neither writes before and after the barrier are enclosed in a seq-writer +* critical section that would ensure readers are aware of ongoing writes. +* * seqcount_t seq; * bool X = true, Y = false; *
@@ -261,11 +268,11 @@ static inline void raw_write_seqcount_end(seqcount_t *s)* * void write(void) * { -* Y = true; +* WRITE_ONCE(Y, true); * * raw_write_seqcount_barrier(seq); * -* X = false; +* WRITE_ONCE(X, false); * } */ static inline void raw_write_seqcount_barrier (seqcount_t *s)
include/linux/skbuff.h +14 -2
@@ -1549,6 +1549,18 @@ static inline __u32 skb_queue_len(const struct sk_buff_head *list_)return list_->qlen; } +/** +* skb_queue_len_lockless - get queue length +* @list_: list to measure +* +* Return the length of an &sk_buff queue. +* This variant can be used in lockless contexts. +*/ +static inline __u32 skb_queue_len_lockless (const struct sk_buff_head *list_) +{ +return READ_ONCE (list_->qlen); +} +/** * __skb_queue_head_init - initialize non-spinlock portions of sk_buff_head * @list: queue to initialize
@@ -1752,7 +1764,7 @@ static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list) {struct sk_buff *next, *prev; - list->qlen--; +WRITE_ONCE (list->qlen, list->qlen -1 ); next = skb->next; prev = skb->prev; skb->next = skb->prev =NULL ;
@@ -2795,7 +2807,7 @@ static inline int skb_padto(struct sk_buff *skb, unsigned int len)* is untouched. Otherwise it is extended. Returns zero on * success. The skb is freed on error. */ -static inline int skb_put_padto (struct sk_buff *skb,unsigned int len) +static inline int __must_check skb_put_padto (struct sk_buff *skb,unsigned int len) {unsigned int size = skb->len;
kernel/audit_watch.c +0 -2
@@ -316,8 +316,6 @@ static void audit_update_watch(struct audit_parent *parent,if (oentry->rule.exe)audit_remove_mark (oentry->rule.exe); -audit_watch_log_rule_change (r, owatch,"updated_rules" ); -call_rcu (&oentry->rcu, audit_free_rule_rcu); }
kernel/bpf/hashtab.c +0 -8
@@ -427,15 +427,7 @@ static void htab_elem_free_rcu(struct rcu_head *head) struct htab_elem *l = container_of(head, struct htab_elem, rcu);struct bpf_htab *htab = l->htab; -/* must increment bpf_prog_active to avoid kprobe+bpf triggering while -* we're calling kfree, otherwise deadlock is possible if kprobes -* are placed somewhere inside of slub -*/ -preempt_disable (); -__this_cpu_inc (bpf_prog_active);htab_elem_free (htab, l); -__this_cpu_dec (bpf_prog_active); -preempt_enable (); }static void free_htab_elem (struct bpf_htab *htab,struct htab_elem *l)
kernel/kprobes.c +11 -3
@@ -2012,6 +2012,9 @@ static void kill_kprobe(struct kprobe *p) {struct kprobe *kp; +if (WARN_ON_ONCE (kprobe_gone (p))) +return ; + p->flags |=KPROBE_FLAG_GONE ;if (kprobe_aggrprobe (p)) {/*
@@ -2032,9 +2035,10 @@ static void kill_kprobe(struct kprobe *p)/* * The module is going away. We should disarm the kprobe which -* is using ftrace. +* is using ftrace, because ftrace framework is still available at +* MODULE_STATE_GOING notification. */ -if (kprobe_ftrace (p)) +if (kprobe_ftrace (p) && !kprobe_disabled (p) && !kprobes_all_disarmed)disarm_kprobe_ftrace (p); }
@@ -2154,7 +2158,10 @@ static int kprobes_module_callback(struct notifier_block *nb,mutex_lock (&kprobe_mutex);for (i =0 ; i <KPROBE_TABLE_SIZE ; i++) { head = &kprobe_table[i]; -hlist_for_each_entry_rcu (p, head, hlist) +hlist_for_each_entry_rcu (p, head, hlist) { +if (kprobe_gone (p)) +continue ; +if (within_module_init ((unsigned long )p->addr, mod) || (checkcore &&within_module_core ((unsigned long )p->addr, mod))) {
@@ -2165,6 +2172,7 @@ static int kprobes_module_callback(struct notifier_block *nb,*/ kill_kprobe (p); } + } }mutex_unlock (&kprobe_mutex);return NOTIFY_DONE ;
kernel/printk/printk.c +3 -0
@@ -2035,6 +2035,9 @@ static int __init console_setup(char *str)char *s, *options, *brl_options =NULL ;int idx; +if (str[0 ] ==0 ) +return 1 ; +if (_braille_console_setup (&str, &brl_options))return 1 ;
kernel/sys.c +3 -1
@@ -1183,11 +1183,13 @@ SYSCALL_DEFINE1(uname, struct old_utsname __user *, name) SYSCALL_DEFINE1(olduname, struct oldold_utsname __user *, name) { -struct oldold_utsname tmp = {}; +struct oldold_utsname tmp;if (!name)return -EFAULT ; +memset (&tmp,0 ,sizeof (tmp)); +down_read (&uts_sem);memcpy (&tmp.sysname, &utsname ()->sysname, __OLD_UTS_LEN);memcpy (&tmp.nodename, &utsname ()->nodename, __OLD_UTS_LEN);
kernel/time/timekeeping.c +1 -2
@@ -950,9 +950,8 @@ static int scale64_check_overflow(u64 mult, u64 div, u64 *base) ((int)sizeof(u64)*8 - fls64(mult) < fls64(rem))) return -EOVERFLOW; tmp *= mult; - rem *= mult; -do_div (rem, div); + rem =div64_u64 (rem * mult, div); *base = tmp + rem;return 0 ; }
kernel/trace/trace.c +4 -1
@@ -2600,6 +2600,9 @@ int trace_array_printk(struct trace_array *tr,if (!(global_trace.trace_flags &TRACE_ITER_PRINTK ))return 0 ; +if (!tr) +return -ENOENT ; +va_start (ap, fmt); ret =trace_array_vprintk (tr, ip, fmt, ap);va_end (ap);
@@ -7693,7 +7696,7 @@ __init static int tracer_alloc_buffers(void) goto out_free_buffer_mask;/* Only allocate trace_printk buffers if a trace_printk exists */ -if (__stop___trace_bprintk_fmt != __start___trace_bprintk_fmt) +if (&__stop___trace_bprintk_fmt != &__start___trace_bprintk_fmt)/* Must be called before global_trace.buffer is allocated */ trace_printk_init_buffers ();
kernel/trace/trace_entries.h +1 -1
@@ -178,7 +178,7 @@ FTRACE_ENTRY(kernel_stack, stack_entry,F_STRUCT (__field (int ,size ) - __dynamic_array(unsigned long, caller ) + __array( unsigned long, caller, FTRACE_STACK_ENTRIES ) ), F_printk("\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n"
kernel/trace/trace_events.c +2 -0
@@ -790,6 +790,8 @@ static int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set)char *event =NULL , *sub =NULL , *match;int ret; +if (!tr) +return -ENOENT ;/* * The buf format can be <subsystem>:<event-name> * *:<event-name> means any event by that name.
lib/string.c +24 -0
@@ -235,6 +235,30 @@ ssize_t strscpy(char *dest, const char *src, size_t count)EXPORT_SYMBOL (strscpy);#endif +/** +* stpcpy - copy a string from src to dest returning a pointer to the new end +* of dest, including src's %NUL-terminator. May overrun dest. +* @dest: pointer to end of string being copied into. Must be large enough +* to receive copy. +* @src: pointer to the beginning of string being copied from. Must not overlap +* dest. +* +* stpcpy differs from strcpy in a key way: the return value is a pointer +* to the new %NUL-terminating character in @dest. (For strcpy, the return +* value is a pointer to the start of @dest). This interface is considered +* unsafe as it doesn't perform bounds checking of the inputs. As such it's +* not recommended for usage. Instead, its definition is provided in case +* the compiler lowers other libcalls to stpcpy. +*/ +char *stpcpy (char *__restrict__ dest,const char *__restrict__ src); +char *stpcpy (char *__restrict__ dest,const char *__restrict__ src) +{ +while ((*dest++ = *src++) !='\0' ) +/* nothing */ ; +return --dest; +} +EXPORT_SYMBOL (stpcpy); +#ifndef __HAVE_ARCH_STRCAT/** * strcat - Append one %NUL-terminated string to another
mm/filemap.c +8 -0
@@ -2474,6 +2474,14 @@ static struct page *do_read_cache_page(struct address_space *mapping,unlock_page (page); goto out; } + +/* +* A previous I/O error may have been due to temporary +* failures. +* Clear page error before actual read, PG_error will be +* set again if read page fails. +*/ +ClearPageError (page); goto filler; out:
mm/mmap.c +2 -0
@@ -2028,6 +2028,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, info.low_limit = mm->mmap_base; info.high_limit =TASK_SIZE ; info.align_mask =0 ; + info.align_offset =0 ; return vm_unmapped_area(&info); }#endif
@@ -2069,6 +2070,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, info.low_limit =max (PAGE_SIZE , mmap_min_addr); info.high_limit = mm->mmap_base; info.align_mask =0 ; + info.align_offset =0 ; addr =vm_unmapped_area (&info);/*
mm/pagewalk.c +2 -2
@@ -14,9 +14,9 @@ static int walk_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, err = walk->pte_entry (pte, addr, addr +PAGE_SIZE , walk);if (err)break ; - addr +=PAGE_SIZE ; -if (addr == end) +if (addr >= end -PAGE_SIZE )break ; + addr +=PAGE_SIZE ; pte++; }
net/atm/lec.c +6 -0
@@ -1290,6 +1290,12 @@ static void lec_arp_clear_vccs(struct lec_arp_table *entry) entry->vcc =NULL ; }if (entry->recv_vcc) { +struct atm_vcc *vcc = entry->recv_vcc; +struct lec_vcc_priv *vpriv =LEC_VCC_PRIV (vcc); + +kfree (vpriv); + vcc->user_back =NULL ; + entry->recv_vcc->push = entry->old_recv_push;vcc_release_async (entry->recv_vcc, -EPIPE ); entry->recv_vcc =NULL ;
net/batman-adv/bridge_loop_avoidance.c +30 -12
83 lines not on this page · raw message
net/batman-adv/bridge_loop_avoidance.h +2 -2
@@ -29,7 +29,7 @@ struct sk_buff;#ifdef CONFIG_BATMAN_ADV_BLA bool batadv_bla_rx (struct batadv_priv *bat_priv,struct sk_buff *skb, -unsigned short vid,bool is_bcast); +unsigned short vid,int packet_type);bool batadv_bla_tx (struct batadv_priv *bat_priv,struct sk_buff *skb,unsigned short vid); bool batadv_bla_is_backbone_gw(struct sk_buff *skb,
@@ -56,7 +56,7 @@ int batadv_bla_claim_dump(struct sk_buff *msg, struct netlink_callback *cb);static inline bool batadv_bla_rx (struct batadv_priv *bat_priv,struct sk_buff *skb,unsigned short vid, -bool is_bcast) +int packet_type) {return false; }
net/batman-adv/routing.c +4 -0
@@ -803,6 +803,10 @@ static bool batadv_check_unicast_ttvn(struct batadv_priv *bat_priv, vid =batadv_get_vid (skb, hdr_len); ethhdr = (struct ethhdr *)(skb->data + hdr_len); +/* do not reroute multicast frames in a unicast header */ +if (is_multicast_ether_addr (ethhdr->h_dest)) +return true; +/* check if the destination client was served by this node and it is now * roaming. In this case, it means that the node has got a ROAM_ADV * message and that it knows the new destination in the mesh to re-route
net/batman-adv/soft-interface.c +3 -3
@@ -415,10 +415,10 @@ void batadv_interface_rx(struct net_device *soft_iface,struct vlan_ethhdr *vhdr;struct ethhdr *ethhdr;unsigned short vid; -bool is_bcast; +int packet_type; batadv_bcast_packet = (struct batadv_bcast_packet *)skb->data; - is_bcast = (batadv_bcast_packet->packet_type ==BATADV_BCAST ); + packet_type = batadv_bcast_packet->packet_type;skb_pull_rcsum (skb, hdr_size);skb_reset_mac_header (skb);
@@ -463,7 +463,7 @@ void batadv_interface_rx(struct net_device *soft_iface,/* Let the bridge loop avoidance check the packet. If will * not handle it, we can safely push it up. */ -if (batadv_bla_rx (bat_priv, skb, vid, is_bcast)) +if (batadv_bla_rx (bat_priv, skb, vid, packet_type)) goto out;if (orig_node)
net/bluetooth/hci_event.c +23 -2
@@ -41,12 +41,27 @@/* Handle HCI Event packets */ -static void hci_cc_inquiry_cancel (struct hci_dev *hdev,struct sk_buff *skb) +static void hci_cc_inquiry_cancel (struct hci_dev *hdev,struct sk_buff *skb, +u8 *new_status) {__u8 status = *((__u8 *) skb->data);BT_DBG ("%s status 0x%2.2x" , hdev->name, status); +/* It is possible that we receive Inquiry Complete event right +* before we receive Inquiry Cancel Command Complete event, in +* which case the latter event should have status of Command +* Disallowed (0x0c). This should not be treated as error, since +* we actually achieve what Inquiry Cancel wants to achieve, +* which is to end the last Inquiry session. +*/ +if (status ==0x0c && !test_bit (HCI_INQUIRY , &hdev->flags)) { +bt_dev_warn (hdev,"Ignoring error of Inquiry Cancel command" ); + status =0x00 ; + } + + *new_status = status; +if (status)return ;
@@ -2772,7 +2787,7 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb,switch (*opcode) {case HCI_OP_INQUIRY_CANCEL : -hci_cc_inquiry_cancel (hdev, skb); +hci_cc_inquiry_cancel (hdev, skb, status);break ;case HCI_OP_PERIODIC_INQ :
@@ -5257,6 +5272,11 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)u8 status =0 , event = hdr->evt, req_evt =0 ;u16 opcode =HCI_OP_NOP ; +if (!event) { +bt_dev_warn (hdev,"Received unexpected HCI Event 00000000" ); + goto done; + } +if (hdev->sent_cmd &&bt_cb (hdev->sent_cmd)->hci.req_event == event) {struct hci_command_hdr *cmd_hdr = (void *) hdev->sent_cmd->data; opcode =__le16_to_cpu (cmd_hdr->opcode);
@@ -5468,6 +5488,7 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)req_complete_skb (hdev, status, opcode, orig_skb); } +done:kfree_skb (orig_skb);kfree_skb (skb); hdev->stat.evt_rx++;
net/bluetooth/l2cap_core.c +17 -12
@@ -414,6 +414,9 @@ static void l2cap_chan_timeout(struct work_struct *work)BT_DBG ("chan %p state %s" , chan,state_to_string (chan->state));mutex_lock (&conn->chan_lock); +/* __set_chan_timer() calls l2cap_chan_hold(chan) while scheduling +* this work. No need to call l2cap_chan_hold(chan) here again. +*/ l2cap_chan_lock (chan);if (chan->state ==BT_CONNECTED || chan->state ==BT_CONFIG )
@@ -426,12 +429,12 @@ static void l2cap_chan_timeout(struct work_struct *work)l2cap_chan_close (chan, reason); -l2cap_chan_unlock (chan); - chan->ops->close (chan); -mutex_unlock (&conn->chan_lock); +l2cap_chan_unlock (chan);l2cap_chan_put (chan); + +mutex_unlock (&conn->chan_lock); }struct l2cap_chan *l2cap_chan_create (void )
@@ -1725,9 +1728,9 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err)l2cap_chan_del (chan, err); -l2cap_chan_unlock (chan); - chan->ops->close (chan); + +l2cap_chan_unlock (chan);l2cap_chan_put (chan); }
@@ -4104,7 +4107,8 @@ static inline int l2cap_config_req(struct l2cap_conn *conn,return 0 ; } -if (chan->state !=BT_CONFIG && chan->state !=BT_CONNECT2 ) { +if (chan->state !=BT_CONFIG && chan->state !=BT_CONNECT2 && + chan->state !=BT_CONNECTED ) {cmd_reject_invalid_cid (conn, cmd->ident, chan->scid, chan->dcid); goto unlock;
@@ -4327,6 +4331,7 @@ static inline int l2cap_disconnect_req(struct l2cap_conn *conn,return 0 ; } +l2cap_chan_hold (chan);l2cap_chan_lock (chan); rsp.dcid =cpu_to_le16 (chan->scid);
@@ -4335,12 +4340,11 @@ static inline int l2cap_disconnect_req(struct l2cap_conn *conn, chan->ops->set_shutdown (chan);
Lines of this file are not shown. View the raw message.
net/sunrpc/xprtrdma/svc_rdma_backchannel.c +1 -0
Lines of this file are not shown. View the raw message.
tools/testing/selftests/x86/syscall_nt.c +1 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.