Bill Pemberton [Tue, 9 Oct 2012 18:18:19 +0000 (14:18 -0400)]
staging: dgrp: check for NULL pointer in (un)register_proc_table
register_proc_table and unregister_proc_table didn't deal with the
possibility that the *table pointer could be NULL. Check for this and
return if table is NULL.
Johan Hovold [Wed, 17 Oct 2012 14:31:33 +0000 (16:31 +0200)]
USB: spcp8x5: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.
Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.
Compile-only tested.
Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Wed, 17 Oct 2012 14:31:34 +0000 (16:31 +0200)]
USB: ssu100: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.
Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.
Compile-only tested.
Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Wed, 17 Oct 2012 14:31:35 +0000 (16:31 +0200)]
USB: ti_usb_3410_5052: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.
Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.
Compile-only tested.
Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Wed, 17 Oct 2012 14:31:32 +0000 (16:31 +0200)]
USB: oti6858: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.
Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.
Compile-only tested.
Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Wed, 17 Oct 2012 11:34:59 +0000 (13:34 +0200)]
USB: iuu_phoenix: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.
Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.
Compile-only tested.
Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Wed, 17 Oct 2012 11:35:01 +0000 (13:35 +0200)]
USB: kl5kusb105: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.
Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.
Note that the write waitqueue was initialised but never used.
Compile-only tested.
Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Wed, 17 Oct 2012 11:34:58 +0000 (13:34 +0200)]
USB: io_ti: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.
Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.
Compile-only tested.
Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Wed, 17 Oct 2012 11:35:00 +0000 (13:35 +0200)]
USB: keyspan_pda: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.
Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.
Note that the write waitqueue was initialised but never used.
Compile-only tested.
Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Wed, 17 Oct 2012 11:34:56 +0000 (13:34 +0200)]
USB: f81232: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.
Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.
Compile-only tested.
Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Wed, 17 Oct 2012 11:34:57 +0000 (13:34 +0200)]
USB: io_edgeport: fix port-data memory leak
Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.
Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.
Compile-only tested.
Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Wed, 17 Oct 2012 11:35:02 +0000 (13:35 +0200)]
USB: kobil_sct: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.
Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.
Compile-only tested.
Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold [Wed, 17 Oct 2012 11:34:55 +0000 (13:34 +0200)]
USB: cypress_m8: fix port-data memory leak
Fix port-data memory leak by replacing attach and release with
port_probe and port_remove.
Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.
Compile-only tested.
Cc: <stable@vger.kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ming Lei [Tue, 16 Oct 2012 13:21:21 +0000 (21:21 +0800)]
USB: cdc-acm: fix pipe type of write endpoint
If the write endpoint is interrupt type, usb_sndintpipe() should
be passed to usb_fill_int_urb() instead of usb_sndbulkpipe().
Cc: Oliver Neukum <oneukum@suse.de> Signed-off-by: Ming Lei <ming.lei@canonical.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Henrik Rydberg [Sat, 13 Oct 2012 10:20:36 +0000 (12:20 +0200)]
usbdevfs: Fix broken scatter-gather transfer
The handling of large output bulk transfers is broken; the same user
page is read over and over again. Fixed with this patch.
Cc: stable <stable@vger.kernel.org> Acked-by: Peter Stuge <peter@stuge.se> Acked-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Pull sparc fixes from David Miller:
"Two sparc64 perf bug fixes and add a sysrq facility so I can diagnose
these kinds of problems more quickly in the future."
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
sparc64: Fix bit twiddling in sparc_pmu_enable_event().
sparc64: Add global PMU register dumping via sysrq.
sparc64: Like x86 we should check current->mm during perf backtrace generation.
Heiko Carstens [Wed, 17 Oct 2012 10:18:05 +0000 (12:18 +0200)]
s390/mm,vmemmap: use 1MB frames for vmemmap
Use 1MB frames for vmemmap if EDAT1 is available in order to
reduce TLB pressure
Always use a 1MB frame even if its only partially needed for
struct pages. Otherwise we would end up with a mix of large
frame and page mappings, because vmemmap_populate gets called
for each section (256MB -> 3.5MB memmap) separately.
Worst case is that we would waste 512KB.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Michael Holzheu [Mon, 15 Oct 2012 13:09:08 +0000 (15:09 +0200)]
s390/kdump: Use 64 bit mode for 0x10000 entry point
The 0x10000 entry point can be called in z/Arch architecture and 64 bit
addressing mode. Therefore this patch removes the unnecessary 31 bit
switch code from the kdump startup function.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
perf_cpum_cf: Add support for counters available with IBM zEC12
Increase the maximum number of available counters and check if
the hardware supports the counter. Support is indicated by the
version of the CPU-measurement counter facility.
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Sebastian Ott [Mon, 15 Oct 2012 10:24:56 +0000 (12:24 +0200)]
s390/css: stop stsch loop after cc 3
Receiving cc=3 from store subchannel means 2 things:
* the subchannel is not provided
* there are no further subchannels in this subchannel set
With this patch we abort the store subchannel loop after cc=3 (or an
exception) and clear the subsequent bits in the subchannel id set.
Reported-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Acked-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Sebastian Ott [Fri, 12 Oct 2012 08:22:25 +0000 (10:22 +0200)]
s390/cio: use generic bitmap functions
Use generic bitmap functions in the subchannel id bitmap to
simplify and de-bloat the code.
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Acked-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Lukas Czerner [Tue, 16 Oct 2012 09:38:06 +0000 (11:38 +0200)]
jfs: Fix FITRIM argument handling
Currently when 'range->start' is beyond the end of file system
nothing is done and that fact is ignored, where in fact we should return
EINVAL. The same problem is when 'range.len' is smaller than file system
block.
Fix this by adding check for such conditions and return EINVAL
appropriately.
Takashi Iwai [Wed, 17 Oct 2012 12:09:15 +0000 (14:09 +0200)]
Merge tag 'asoc-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.7
Nothing too exciting except for the ams-delta change which is relatively
lerge due to the fact that the driver loading had been totally broken as
the driver needed a newer API to function.
Johannes Berg [Mon, 1 Oct 2012 13:52:00 +0000 (15:52 +0200)]
mac80211: connect with HT20 if HT40 is not permitted
Some changes to fix issues with HT40 APs in Korea
and follow-up changes to allow using HT40 even if
the local regulatory database disallows it caused
issues with iwlwifi (and could cause issues with
other devices); iwlwifi firmware would assert if
you tried to connect to an AP that has an invalid
configuration (e.g. using HT40- on channel 140.)
Fix this, while avoiding the "Korean AP" issue by
disabling HT40 and advertising HT20 to the AP
when connecting.
Will Deacon [Wed, 15 Aug 2012 14:39:32 +0000 (15:39 +0100)]
ARM: perf: fix updated event period in response to PERF_EVENT_IOC_PERIOD
The PERF_EVENT_IOC_PERIOD ioctl command can be used to change the
sample period of a running perf_event. Consequently, when calculating
the next event period, the new period will only be considered after the
previous one has overflowed.
This patch changes the calculation of the remaining event ticks so that
they are offset if the period has changed.
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Reported-by: Andreas Sandberg <andreas.sandberg@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Steven Rostedt [Sat, 13 Oct 2012 02:26:36 +0000 (22:26 -0400)]
blackfin: Use Kbuild infrastructure for kvm_para.h
All the headers but kvm_para.h use the Kbuild infrastructure to
get to the asm-generic headers.
Cc: linux-kbuild@vger.kernel.org Cc: uclinux-dist-devel@blackfin.uclinux.org Cc: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Bob Liu <lliubbo@gmail.com>
Linus Torvalds [Wed, 17 Oct 2012 02:24:00 +0000 (19:24 -0700)]
Merge tag 'sh-for-linus' of git://github.com/pmundt/linux-sh
Pull SuperH updates from Paul Mundt.
The bulk of this is the UAPI disintegration for SH.
* tag 'sh-for-linus' of git://github.com/pmundt/linux-sh:
sh: Fix up more fallout from pointless ARM __iomem churn.
sh: Wire up kcmp syscall.
UAPI: (Scripted) Disintegrate arch/sh/include/asm
David Howells [Mon, 15 Oct 2012 23:10:35 +0000 (00:10 +0100)]
FRV: Fix linux/elf-fdpic.h
It seems I accidentally switched the guard on linux/elf-fdpic.h from #ifdef
__KERNEL__ to #ifndef __KERNEL__ when attempting to expand the guarded region
to cover the elf_fdpic_params struct when doing the UAPI split - with the
result that the struct became unavailable to kernel code.
Move incorrectly guarded bits back to the kernelspace header.
Whilst we're at it, the __KERNEL__ guards can be deleted as they're no longer
necessary.
Andi Kleen [Mon, 15 Oct 2012 23:10:28 +0000 (00:10 +0100)]
FRV: Fix const sections change
Add __pminitconst to fix the build, otherwise the following error can occur:
arch/frv/kernel/setup.c:187:47: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
arch/frv/kernel/setup.c:386:2: error: 'clock_cmodes' undeclared (first use in this function)
arch/frv/kernel/setup.c:571:6: error: 'clock_cmodes' undeclared (first use in this function)
make[2]: *** [arch/frv/kernel/setup.o] Error 1
David Howells [Mon, 15 Oct 2012 23:10:21 +0000 (00:10 +0100)]
FRV: Fix incorrect symbol in copy_thread()
Fix an incorrect symbol in copy_thread():
arch/frv/kernel/process.c: In function 'copy_thread':
arch/frv/kernel/process.c:197: error: 'chilregs' undeclared (first use in this function)
arch/frv/kernel/process.c:197: error: (Each undeclared identifier is reported only once
arch/frv/kernel/process.c:197: error: for each function it appears in.)
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Al Viro <viro@ZenIV.linux.org.uk>
cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
When packing CALLL with OR, CALLL must go in the first slot. The
instructions are executed simultaneously, so it doesn't matter which way
round they're packed from that point of view.
Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Paul E. McKenney [Tue, 16 Oct 2012 04:35:59 +0000 (21:35 -0700)]
printk: Fix scheduling-while-atomic problem in console_cpu_notify()
The console_cpu_notify() function runs with interrupts disabled in the
CPU_DYING case. It therefore cannot block, for example, as will happen
when it calls console_lock(). Therefore, remove the CPU_DYING leg of
the switch statement to avoid this problem.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (31 commits)
nouveau: fix warning on 32-bit build.
drm/nouveau/bios: fix typo in error message
drm/nouveau: only call ttm_agp_tt_create when __OS_HAS_AGP
drm/nv50/fb: fix double free of vram mm
drm/nouveau/pm: do not stop reclocking if failing to set the fan speed
drm/nouveau/pm: fix a typo related to the move to the therm subdev
drm/nouveau/hwmon: fix the initialization condition
drm: fix warning on 32-bit.
drm: radeon: fix printk format warning
drm/radeon: fix spelling typos in debugging output
drm/radeon: Don't destroy I2C Bus Rec in radeon_ext_tmds_enc_destroy().
drm/radeon: check if pcie gen 2 is already enabled (v2)
drm/radeon/cayman: set VM max pfn at MC init
drm/radeon: separate pt alloc from lru add
drm/radeon: don't add the IB pool to all VMs v2
drm/radeon: allocate page tables on demand v4
drm/radeon: update comments to clarify VM setup (v2)
drm/radeon: allocate PPLLs from low to high
drm/radeon: fix compilation with backlight disabled
drm/radeon: use %zu for formatting size_t
...
Linus Torvalds [Wed, 17 Oct 2012 01:12:38 +0000 (18:12 -0700)]
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull ext2, ext3, quota fixes from Jan Kara:
"Fix three regressions caused by user namespace conversions (ext2,
ext3, quota) and minor ext3 fix and cleanup."
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
quota: Silence warning about PRJQUOTA not being handled in need_print_warning()
ext3: fix return values on parse_options() failure
ext2: fix return values on parse_options() failure
ext3: ext3_bread usage audit
ext3: fix possible non-initialized variable on htree_dirblock_to_tree()
Linus Torvalds [Wed, 17 Oct 2012 01:11:48 +0000 (18:11 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs fixes from Al Viro:
"Fix for my braino in replace_fd(), dhowell's fix for the fallout from
over-enthusiastic bo^Wdeclaration movements plus crapectomy that
should've happened a long time ago (SEL_... definitions)."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
bury SEL_{IN,OUT,EX}
Unexport some bits of linux/fs.h
fix a leak in replace_fd() users
Linus Torvalds [Wed, 17 Oct 2012 01:10:26 +0000 (18:10 -0700)]
Merge tag 'pinctrl-fixes-v3.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pinctrl fixes from Linus Walleij:
"A number of pinctrl fixes for the v3.7 series:
- duplicate includes, section markup, code mishaps
- erroneous return value in errorpath on the bcm2835 driver
- remove an unused sirf function that was causing build errors
- multiple-platform compilation stubs and a missed code review
comment fixup on the nomadik pin controller"
* tag 'pinctrl-fixes-v3.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
pinctrl/nomadik: always use the simple irqdomain
pinctrl/nomadik: provide stubs for legacy Nomadik
pinctrl: remove duplicated include from pinctrl-xway.c
pinctrl: sirf: remove sirfsoc_gpio_set_pull function
pinctrl: fix return value in bcm2835_pinctrl_probe()
pinctrl: remove duplicated include from pinctrl-bcm2835.c
pinctrl: bcm2835: Use existing pointer to struct device
pinctrl: samsung: use __devinit section for init code
Linus Torvalds [Wed, 17 Oct 2012 01:08:21 +0000 (18:08 -0700)]
Merge branch 'ipmi' (IPMI patches from Corey Minyard)
Merge emailed patches from Corey Minyard:
"Remove some bogus docs, Fix ACPI/IPMI interactions, fix some warnings,
and add register spacing detection for PCI interfaces."
* ipmi:
IPMI: Detect register spacing on PCI interfaces
IPMI: Fix some uninitialized warning
IPMI: Change link order
ACPI: Reorder IPMI driver before any other ACPI drivers
IPMI: Remove SMBus driver info from the docs
Matthew Garrett [Tue, 16 Oct 2012 20:53:38 +0000 (15:53 -0500)]
IPMI: Change link order
IPMI must be initialised before ACPI in order to ensure that any IPMI
services are available before ACPI driver initialisation attempts to use
any IPMI operation regions.
Corey Minyard [Tue, 16 Oct 2012 20:53:36 +0000 (15:53 -0500)]
IPMI: Remove SMBus driver info from the docs
Some documentation for the SMBus driver is in the IPMI docs, but that
code is not in the kernel tree at this point. So remove the docs to
avoid confusion.
David Rientjes [Wed, 17 Oct 2012 00:31:23 +0000 (17:31 -0700)]
mm, mempolicy: fix printing stack contents in numa_maps
When reading /proc/pid/numa_maps, it's possible to return the contents of
the stack where the mempolicy string should be printed if the policy gets
freed from beneath us.
This happens because mpol_to_str() may return an error the
stack-allocated buffer is then printed without ever being stored.
There are two possible error conditions in mpol_to_str():
- if the buffer allocated is insufficient for the string to be stored,
and
- if the mempolicy has an invalid mode.
The first error condition is not triggered in any of the callers to
mpol_to_str(): at least 50 bytes is always allocated on the stack and this
is sufficient for the string to be written. A future patch should convert
this into BUILD_BUG_ON() since we know the maximum strlen possible, but
that's not -rc material.
The second error condition is possible if a race occurs in dropping a
reference to a task's mempolicy causing it to be freed during the read().
The slab poison value is then used for the mode and mpol_to_str() returns
-EINVAL.
This race is only possible because get_vma_policy() believes that
mm->mmap_sem protects task->mempolicy, which isn't true. The exit path
does not hold mm->mmap_sem when dropping the reference or setting
task->mempolicy to NULL: it uses task_lock(task) instead.
Thus, it's required for the caller of a task mempolicy to hold
task_lock(task) while grabbing the mempolicy and reading it. Callers with
a vma policy store their mempolicy earlier and can simply increment the
reference count so it's guaranteed not to be freed.
Reported-by: Dave Jones <davej@redhat.com> Signed-off-by: David Rientjes <rientjes@google.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>