]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
13 years agodrivers/scsi/sd.c: use ida_simple_get() and ida_simple_remove() in place of boilerpla...
Jonathan Cameron [Wed, 28 Sep 2011 00:49:49 +0000 (10:49 +1000)]
drivers/scsi/sd.c: use ida_simple_get() and ida_simple_remove() in place of boilerplate code

Some mangling of errors was necessary to maintain current interface.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Tejun Heo <tj@kernel.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <>
13 years agodrivers/scsi/aacraid/commctrl.c: fix mem leak in aac_send_raw_srb()
Jesper Juhl [Wed, 28 Sep 2011 00:49:49 +0000 (10:49 +1000)]
drivers/scsi/aacraid/commctrl.c: fix mem leak in aac_send_raw_srb()

We leak in drivers/scsi/aacraid/commctrl.c::aac_send_raw_srb() :

We allocate memory:
        ...
                        struct user_sgmap* usg;
                        usg = kmalloc(actual_fibsize - sizeof(struct aac_srb)
                          + sizeof(struct sgmap), GFP_KERNEL);
and then neglect to free it:
        ...
                        for (i = 0; i < usg->count; i++) {
                                u64 addr;
                                void* p;
                                if (usg->sg[i].count >
                                    ((dev->adapter_info.options &
                                     AAC_OPT_NEW_COMM) ?
                                      (dev->scsi_host_ptr->max_sectors << 9) :
                                      65536)) {
                                        rcode = -EINVAL;
                                        goto cleanup;
        ... this 'goto' makes 'usg' go out of scope and leak the memory we
            allocated.
            Other exits properly kfree(usg), it's just here it is neglected.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <>
13 years agodrivers/scsi/megaraid.c: fix sparse warnings
Randy Dunlap [Wed, 28 Sep 2011 00:49:48 +0000 (10:49 +1000)]
drivers/scsi/megaraid.c: fix sparse warnings

Fix sparse warnings of right shift bigger than source value size:

drivers/scsi/megaraid.c:311:65: warning: right shift by bigger than source value
drivers/scsi/megaraid.c:313:65: warning: right shift by bigger than source value
drivers/scsi/megaraid.c:317:67: warning: right shift by bigger than source value
drivers/scsi/megaraid.c:319:67: warning: right shift by bigger than source value

Patch suggestion from email by Al Viro:

"Since both are claimed to be strings, I really suspect that this >> 8 is
misspelled >> 4 and they have a character followed by pair of two-digit
packed decimals in there..."

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Neela Syam Kolli <megaraidlinux@lsi.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <>
13 years agoscsi: fix a header to include linux/types.h
Alexander Shishkin [Wed, 28 Sep 2011 00:49:48 +0000 (10:49 +1000)]
scsi: fix a header to include linux/types.h

For headers that get exported to userland and make use of u32 style
type names, it is advised to include linux/types.h.

This fixes a headers_check warning.

Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <>
13 years agodrivers/firmware/dmi_scan.c: make dmi_name_in_vendors more focused
Jean Delvare [Wed, 28 Sep 2011 00:49:48 +0000 (10:49 +1000)]
drivers/firmware/dmi_scan.c: make dmi_name_in_vendors more focused

The current implementation of dmi_name_in_vendors() is an invitation to
lazy coding and false positives [1].  Searching for a string in 8 know
what you're looking for, so you should know where to look.  strstr isn't
fast, especially when it fails, so we should avoid calling it when it just
can't succeed.

Looking at the current users of the function, it seems clear to me that
they are looking for a system or board vendor name, so let's limit
dmi_name_in_vendors to these two DMI fields.  This much better matches the
function name, BTW.

[1] We currently have code looking for short names in DMI data, such
as "IBM", "ASUS" or "Acer". I let you guess what will happen the day
other vendors ship products named, for example, "SCHREIBMEISTER",
"PEGASUS" or "Acerola".

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Andrew Morton <>
13 years agoparisc, exec: remove redundant set_fs(USER_DS)
Mathias Krause [Wed, 28 Sep 2011 00:49:47 +0000 (10:49 +1000)]
parisc, exec: remove redundant set_fs(USER_DS)

The address limit is already set in flush_old_exec() so those calls to
set_fs(USER_DS) are redundant.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Helge Deller <deller@gmx.de>
Signed-off-by: Andrew Morton <>
13 years agoocfs2: avoid unaligned access to dqc_bitmap
Akinobu Mita [Wed, 28 Sep 2011 00:49:47 +0000 (10:49 +1000)]
ocfs2: avoid unaligned access to dqc_bitmap

The dqc_bitmap field of struct ocfs2_local_disk_chunk is 32-bit aligned,
but not 64-bit aligned.  The dqc_bitmap is accessed by ocfs2_set_bit(),
ocfs2_clear_bit(), ocfs2_test_bit(), or ocfs2_find_next_zero_bit().  These
are wrapper macros for ext2_*_bit() which need to take an unsigned long
aligned address (though some architectures are able to handle unaligned
address correctly)

So some 64bit architectures may not be able to access the dqc_bitmap
correctly.

This avoids such unaligned access by using another wrapper functions for
ext2_*_bit().  The code is taken from fs/ext4/mballoc.c which also need to
handle unaligned bitmap access.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <>
13 years agoext4: use proper little-endian bitops
Akinobu Mita [Wed, 28 Sep 2011 00:49:47 +0000 (10:49 +1000)]
ext4: use proper little-endian bitops

ext4_{set,clear}_bit() is defined as __test_and_{set,clear}_bit_le() for
ext4.  Only two ext4_{set,clear}_bit() calls check the return value.  The
rest of calls ignore the return value and they can be replaced with
__{set,clear}_bit_le().

This changes ext4_{set,clear}_bit() from __test_and_{set,clear}_bit_le()
to __{set,clear}_bit_le() and introduces ext4_test_and_{set,clear}_bit()
for the two places where old bit needs to be returned.

This ext4_{set,clear}_bit() change is considered safe, because if someone
uses these macros without noticing the change, new ext4_{set,clear}_bit
don't have return value and causes compiler errors where the return value
is used.

This also removes unused ext4_find_first_zero_bit().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Signed-off-by: Andrew Morton <>
13 years agokernel/timer.c: use debugobjects to catch deletion of uninitialized timers
Christine Chan [Wed, 28 Sep 2011 00:49:46 +0000 (10:49 +1000)]
kernel/timer.c: use debugobjects to catch deletion of uninitialized timers

del_timer_sync() calls debug_object_assert_init() to assert that a timer
has been initialized before calling lock_timer_base().  lock_timer_base()
would spin forever on a NULL(uninit-ed) base.  The check is added to
del_timer() to prevent silent failure, even though it would not get stuck
in an infinite loop.

Signed-off-by: Christine Chan <cschan@codeaurora.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Andrew Morton <>
13 years agodebugobjects: extend debugobjects to assert that an object is initialized
Christine Chan [Wed, 28 Sep 2011 00:49:46 +0000 (10:49 +1000)]
debugobjects: extend debugobjects to assert that an object is initialized

Add new check (assert_init) to make sure objects are initialized and
tracked by debugobjects.

Signed-off-by: Christine Chan <cschan@codeaurora.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Andrew Morton <>
13 years agounicore32, exec: remove redundant set_fs(USER_DS)
Mathias Krause [Wed, 28 Sep 2011 00:49:45 +0000 (10:49 +1000)]
unicore32, exec: remove redundant set_fs(USER_DS)

The address limit is already set in flush_old_exec() so this
set_fs(USER_DS) is redundant.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Signed-off-by: Andrew Morton <>
13 years agoia64, exec: remove redundant set_fs(USER_DS)
Mathias Krause [Wed, 28 Sep 2011 00:49:44 +0000 (10:49 +1000)]
ia64, exec: remove redundant set_fs(USER_DS)

The address limit is already set in flush_old_exec() so this
set_fs(USER_DS) is redundant.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <>
13 years agodrivers/gpu/vga/vgaarb.c: add missing kfree
Julia Lawall [Wed, 28 Sep 2011 00:49:44 +0000 (10:49 +1000)]
drivers/gpu/vga/vgaarb.c: add missing kfree

kbuf is a buffer that is local to this function, so all of the error paths
leaving the function should release it.

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Andrew Morton <>
13 years agodrivers/edac/mpc85xx_edac.c: fix memory controller compatible for edac
Shaohui Xie [Wed, 28 Sep 2011 00:49:44 +0000 (10:49 +1000)]
drivers/edac/mpc85xx_edac.c: fix memory controller compatible for edac

compatible in dts has been changed, so the driver needs to be updated
accordingly.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <>
13 years agobtrfs: don't dereference extent_mapping if NULL
Roel Kluin [Wed, 28 Sep 2011 00:49:43 +0000 (10:49 +1000)]
btrfs: don't dereference extent_mapping if NULL

Don't dereference em if it's NULL or an error pointer.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Andrew Morton <>
13 years agoaudit: always follow va_copy() with va_end()
Jesper Juhl [Wed, 28 Sep 2011 00:49:43 +0000 (10:49 +1000)]
audit: always follow va_copy() with va_end()

A call to va_copy() should always be followed by a call to va_end() in the
same function.  In kernel/autit.c::audit_log_vformat() this is not always
done.  This patch makes sure va_end() is always called.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric Paris <eparis@redhat.com>
Signed-off-by: Andrew Morton <>
13 years agoarm, exec: remove redundant set_fs(USER_DS)
Mathias Krause [Wed, 28 Sep 2011 00:49:43 +0000 (10:49 +1000)]
arm, exec: remove redundant set_fs(USER_DS)

The address limit is already set in flush_old_exec() so this
set_fs(USER_DS) is redundant.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <>
13 years agoarch/arm/mach-ux500/mbox-db5500.c: world-writable sysfs fifo file
Vasiliy Kulikov [Wed, 28 Sep 2011 00:49:42 +0000 (10:49 +1000)]
arch/arm/mach-ux500/mbox-db5500.c: world-writable sysfs fifo file

Don't allow everybody to use a modem.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Cc: Linus Walleij <linus.walleij@stericsson.com>
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Andrew Morton <>
13 years agox86: tlb flush avoid superflous leave_mm()
Shaohua Li [Wed, 28 Sep 2011 00:49:42 +0000 (10:49 +1000)]
x86: tlb flush avoid superflous leave_mm()

If just one page VA tlb is required to be flushed and current task is in
lazy TLB state, doing leave_mm() is superfluous because it flushes the
whole TLB.  This can reduce some TLB miss.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <>
13 years agoarch/x86/mm/pageattr.c: quiet sparse noise; local functions should be static
H Hartley Sweeten [Wed, 28 Sep 2011 00:49:42 +0000 (10:49 +1000)]
arch/x86/mm/pageattr.c: quiet sparse noise; local functions should be static

Local functions should be marked static.  This quiets the following
sparse noise:

warning: symbol '_set_memory_array' was not declared. Should it be static?

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Andrew Morton <>
13 years agoarch/x86/kernel/ptrace.c: quiet sparse noise
H Hartley Sweeten [Wed, 28 Sep 2011 00:49:41 +0000 (10:49 +1000)]
arch/x86/kernel/ptrace.c: quiet sparse noise

ptrace_set_debugreg() is only used in this file and should be static.
This quiets the following sparse warning:

warning: symbol 'ptrace_set_debugreg' was not declared. Should it be static?

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Andrew Morton <>
13 years agoarch/x86/kernel/e820.c: quiet sparse noise about plain integer as NULL pointer
H Hartley Sweeten [Wed, 28 Sep 2011 00:49:41 +0000 (10:49 +1000)]
arch/x86/kernel/e820.c: quiet sparse noise about plain integer as NULL pointer

The last parameter to sort() is a pointer to the function used to swap
items.  This parameter should be NULL, not 0, when not used.  This quiets
the following sparse warning:

warning: Using plain integer as NULL pointer

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Andrew Morton <>
13 years agox86,mrst: add mapping for bma023
William Douglas [Wed, 28 Sep 2011 00:49:41 +0000 (10:49 +1000)]
x86,mrst: add mapping for bma023

There is now an upstream bma023 driver so instead of submitting ours we
use that one.  The defaults are just fine so it's a simple mapping entry.

(Thanks go to Erik Andersson for incorporating the changes we needed into his
 version)

Signed-off-by: William Douglas <william.douglas@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <>
13 years agodrivers/power/intel_mid_battery.c: fix build
Andrew Morton [Wed, 28 Sep 2011 00:49:40 +0000 (10:49 +1000)]
drivers/power/intel_mid_battery.c: fix build

Seems that nobody's even trying any more.

Cc: Nithish Mahalingam <nithish.mahalingam@intel.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Anton Vorontsov <cbouatmailru@gmail.com>
Cc: Major Lee <major_lee@wistron.com>
Signed-off-by: Andrew Morton <>
13 years agomrst: battery fixes
Major Lee [Wed, 28 Sep 2011 00:49:40 +0000 (10:49 +1000)]
mrst: battery fixes

When DCDC input line over current detecting, PMIC will change charging
current automatically.  Logging event is enough.

Signed-off-by: Major Lee <major_lee@wistron.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: Feng Tang <feng.tang@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <>
13 years agox86: rtc: don't register a platform RTC device for Intel MID platforms
Mathias Nyman [Wed, 28 Sep 2011 00:49:40 +0000 (10:49 +1000)]
x86: rtc: don't register a platform RTC device for Intel MID platforms

Intel MID x86 platforms have a memory mapped virtual RTC instead.  No MID
platform have the default ports (and accessing them may do weird stuff)

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Feng Tang <feng.tang@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <>
13 years agovrtc: change its year offset from 1960 to 1972
Feng Tang [Wed, 28 Sep 2011 00:49:39 +0000 (10:49 +1000)]
vrtc: change its year offset from 1960 to 1972

Real world year equals the value in vrtc YEAR register plus an offset.  We
used 1960 for original developepment as the offset to make leap year
consistent, but for a device's first use, its YEAR register is 0 and the
system year will be parsed as 1960 which is not a valid UNIX time and will
cause many applications to fail mysteriously.  Devices use 1972 instead to
fix this issue.

Updated patch which adds a sanity check suggested by Mathias

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Andrew Morton <>
13 years agoarch/x86/kernel/e820.c: eliminate bubble sort from sanitize_e820_map
Mike Ditto [Wed, 28 Sep 2011 00:49:39 +0000 (10:49 +1000)]
arch/x86/kernel/e820.c: eliminate bubble sort from sanitize_e820_map

Replace the bubble sort in sanitize_e820_map() with a call to the generic
kernel sort function to avoid pathological performance with large maps.

On large (thousands of entries) E820 maps, the previous code took minutes
to run; with this change it's now milliseconds.

Signed-off-by: Mike Ditto <mditto@google.com>
Cc: Stefan Assmann <sassmann@kpanic.de>
Cc: Nancy Yuen <yuenn@google.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <>
13 years agox86: fix mmap random address range
Ludwig Nussel [Wed, 28 Sep 2011 00:49:39 +0000 (10:49 +1000)]
x86: fix mmap random address range

On x86_32 casting the unsigned int result of get_random_int() to long may
result in a negative value.  On x86_32 the range of mmap_rnd() therefore
was -255 to 255.  The 32bit mode on x86_64 used 0 to 255 as intended.

The bug was introduced by 675a081 ("x86: unify mmap_{32|64}.c") in January
2008.

Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Harvey Harrison <harvey.harrison@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <>
13 years agohp_accel: Add axis-mapping for HP ProBook / EliteBook
Takashi Iwai [Wed, 28 Sep 2011 00:49:38 +0000 (10:49 +1000)]
hp_accel: Add axis-mapping for HP ProBook / EliteBook

Add the corrected axis-mapping for some HP laptops.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <>
13 years agohp_accel: Add a new PNP id
Takashi Iwai [Wed, 28 Sep 2011 00:49:38 +0000 (10:49 +1000)]
hp_accel: Add a new PNP id

New HP laptops assign a new PNP id "HPQ6000" for DriveGuard.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <>
13 years agoarch/x86/platform/iris/iris.c: register a platform device and a platform driver
Shérab [Wed, 28 Sep 2011 00:49:37 +0000 (10:49 +1000)]
arch/x86/platform/iris/iris.c: register a platform device and a platform driver

This makes the iris driver use the platform API, so it is properly exposed
in /sys.

[akpm@linux-foundation.org: remove commented-out code, add missing space to printk, clean up code layout]
Signed-off-by: Shérab <Sebastien.Hinderer@ens-lyon.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <>
13 years agoacerhdf: add support for Aspire 1410 BIOS v1.3314
Clay Carpenter [Wed, 28 Sep 2011 00:49:37 +0000 (10:49 +1000)]
acerhdf: add support for Aspire 1410 BIOS v1.3314

Add support for Aspire 1410 BIOS v1.3314.  Fixes the following error:

acerhdf: unknown (unsupported) BIOS version Acer/Aspire 1410/v1.3314,
please report, aborting!

Signed-off-by: Clay Carpenter <claycarpenter@gmail.com>
Signed-off-by: Peter Feuerer <peter@piie.net>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <>
13 years agoreadlinkat: ensure we return ENOENT for the empty pathname for normal lookups
Andy Whitcroft [Wed, 28 Sep 2011 00:49:37 +0000 (10:49 +1000)]
readlinkat: ensure we return ENOENT for the empty pathname for normal lookups

Since the commit below which added O_PATH support to the *at() calls, the
error return for readlink/readlinkat for the empty pathname has switched
from ENOENT to EINVAL:

  commit 65cfc6722361570bfe255698d9cd4dccaf47570d
  Author: Al Viro <viro@zeniv.linux.org.uk>
  Date:   Sun Mar 13 15:56:26 2011 -0400

    readlinkat(), fchownat() and fstatat() with empty relative pathnames

This is both unexpected for userspace and makes readlink/readlinkat
inconsistant with all other interfaces; and inconsistant with our stated
return for these pathnames.

As the readlinkat call does not have a flags parameter we cannot use the
AT_EMPTY_PATH approach used in the other calls.  Therefore expose whether
the original path is infact entry via a new user_path_at_empty() path
lookup function.  Use this to determine whether to default to EINVAL or
ENOENT for failures.

BugLink: http://bugs.launchpad.net/bugs/817187
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <>
13 years agonet/netfilter/nf_conntrack_netlink.c: fix Oops on container destroy
Alex Bligh [Wed, 28 Sep 2011 00:49:36 +0000 (10:49 +1000)]
net/netfilter/nf_conntrack_netlink.c: fix Oops on container destroy

Problem:

A repeatable Oops can be caused if a container with networking
unshared is destroyed when it has nf_conntrack entries yet to expire.

A copy of the oops follows below. A perl program generating the oops
repeatably is attached inline below.

Analysis:

The oops is called from cleanup_net when the namespace is
destroyed. conntrack iterates through outstanding events and calls
death_by_timeout on each of them, which in turn produces a call to
ctnetlink_conntrack_event. This calls nf_netlink_has_listeners, which
oopses because net->nfnl is NULL.

The perl program generates the container through fork() then
clone(NS_NEWNET). I does not explicitly set up netlink
explicitly set up netlink, but I presume it was set up else net->nfnl
would have been NULL earlier (i.e. when an earlier connection
timed out). This would thus suggest that net->nfnl is made NULL
during the destruction of the container, which I think is done by
nfnetlink_net_exit_batch.

I can see that the various subsystems are deinitialised in the opposite
order to which the relevant register_pernet_subsys calls are called,
and both nf_conntrack and nfnetlink_net_ops register their relevant
subsystems. If nfnetlink_net_ops registered later than nfconntrack,
then its exit routine would have been called first, which would cause
the oops described. I am not sure there is anything to prevent this
happening in a container environment.

Whilst there's perhaps a more complex problem revolving around ordering
of subsystem deinit, it seems to me that missing a netlink event on a
container that is dying is not a disaster. An early check for net->nfnl
being non-NULL in ctnetlink_conntrack_event appears to fix this. There
may remain a potential race condition if it becomes NULL immediately
after being checked (I am not sure any lock is held at this point or
how synchronisation for subsystem deinitialization works).

Patch:

The patch attached should apply on everything from 2.6.26 (if not before)
onwards; it appears to be a problem on all kernels. This was taken against
Ubuntu-3.0.0-11.17 which is very close to 3.0.4. I have torture-tested it
with the above perl script for 15 minutes or so; the perl script hung the
machine within 20 seconds without this patch.

Applicability:

If this is the right solution, it should be applied to all stable kernels
as well as head. Apart from the minor overhead of checking one variable
against NULL, it can never 'do the wrong thing', because if net->nfnl
is NULL, an oops will inevitably result. Therefore, checking is a reasonable
thing to do unless it can be proven than net->nfnl will never be NULL.

Check net->nfnl for NULL in ctnetlink_conntrack_event to avoid Oops on
container destroy

Signed-off-by: Alex Bligh <alex@alex.org.uk>
Cc: Patrick McHardy <kaber@trash.net>
Cc: David Miller <davem@davemloft.net>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <>
13 years agodrm: fix kconfig unmet dependency warning
Randy Dunlap [Wed, 28 Sep 2011 00:49:36 +0000 (10:49 +1000)]
drm: fix kconfig unmet dependency warning

Fix kconfig unmet dependency warning.  BACKLIGHT_CLASS_DEVICE depends on
BACKLIGHT_LCD_SUPPORT, so select the latter along with the former.

warning: (DRM_RADEON_KMS && DRM_I915 && STUB_POULSBO && FB_BACKLIGHT && PANEL_SHARP_LS037V7DW01 && PANEL_ACX565AKM && USB_APPLEDISPLAY && FB_OLPC_DCON && ASUS_LAPTOP && SONY_LAPTOP && THINKPAD_ACPI && EEEPC_LAPTOP && ACPI_ASUS && ACPI_CMPC && SAMSUNG_Q10) selects BACKLIGHT_CLASS_DEVICE which has unmet direct dependencies (HAS_IOMEM && BACKLIGHT_LCD_SUPPORT)

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: David Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <>
13 years agodrivers/net/ethernet/i825xx/3c505.c: fix build with dynamic debug
Andrew Morton [Wed, 28 Sep 2011 00:49:36 +0000 (10:49 +1000)]
drivers/net/ethernet/i825xx/3c505.c: fix build with dynamic debug

The `#define filename' screws up the expansion of
DEFINE_DYNAMIC_DEBUG_METADATA:

drivers/net/ethernet/i825xx/3c505.c: In function 'send_pcb':
drivers/net/ethernet/i825xx/3c505.c:390: error: expected identifier before string constant
drivers/net/ethernet/i825xx/3c505.c:390: error: expected '}' before '.' token
drivers/net/ethernet/i825xx/3c505.c:436: error: expected identifier before string constant
drivers/net/ethernet/i825xx/3c505.c:435: error: expected '}' before '.' token
drivers/net/ethernet/i825xx/3c505.c: In function 'start_receive':
drivers/net/ethernet/i825xx/3c505.c:557: error: expected identifier before string constant
drivers/net/ethernet/i825xx/3c505.c:557: error: expected '}' before '.' token
drivers/net/ethernet/i825xx/3c505.c: In function 'receive_packet':
drivers/net/ethernet/i825xx/3c505.c:629: error: expected identifier before string constant

etc

Cc: Philip Blundell <philb@gnu.org>
Cc: David Miller <davem@davemloft.net>
Cc: Jason Baron <jbaron@redhat.com>
Signed-off-by: Andrew Morton <>
13 years agoarch/x86/kernel/cpu/perf_event_amd.c needs asm/apicdef.h
Andrew Morton [Wed, 28 Sep 2011 00:49:35 +0000 (10:49 +1000)]
arch/x86/kernel/cpu/perf_event_amd.c needs asm/apicdef.h

x86_64 allnoconfig:

arch/x86/kernel/cpu/perf_event_amd.c: In function 'amd_pmu_cpu_starting':
arch/x86/kernel/cpu/perf_event_amd.c:350: error: 'BAD_APICID' undeclared (first use in this function)
arch/x86/kernel/cpu/perf_event_amd.c:350: error: (Each undeclared identifier is reported only once
arch/x86/kernel/cpu/perf_event_amd.c:350: error: for each function it appears in.)

Cc: Kevin Winchester <kjwinchester@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Andrew Morton <>
13 years agoinclude/linux/dmar.h: forward-declare struct acpi_dmar_header
Andrew Morton [Wed, 28 Sep 2011 00:49:35 +0000 (10:49 +1000)]
include/linux/dmar.h: forward-declare struct acpi_dmar_header

x86_64 allnoconfig:

In file included from arch/x86/kernel/pci-dma.c:3:
include/linux/dmar.h:248: warning: 'struct acpi_dmar_header' declared inside parameter list
include/linux/dmar.h:248: warning: its scope is only this definition or declaration, which is probably not what you want

Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Andrew Morton <>
13 years agoMerge remote-tracking branch 'kvmtool/master'
Stephen Rothwell [Thu, 29 Sep 2011 06:04:19 +0000 (16:04 +1000)]
Merge remote-tracking branch 'kvmtool/master'

Conflicts:
include/net/9p/9p.h

13 years agoMerge remote-tracking branch 'moduleh/for-sfr'
Stephen Rothwell [Thu, 29 Sep 2011 05:56:07 +0000 (15:56 +1000)]
Merge remote-tracking branch 'moduleh/for-sfr'

Conflicts:
arch/arm/mach-bcmring/mm.c
drivers/media/dvb/frontends/dibx000_common.c
drivers/misc/altera-stapl/altera.c
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
drivers/scsi/libfc/fc_lport.c
drivers/staging/iio/accel/adis16220_core.c
include/linux/dmaengine.h
sound/soc/soc-io.c

13 years agoMerge remote-tracking branch 'hwspinlock/linux-next'
Stephen Rothwell [Thu, 29 Sep 2011 05:44:44 +0000 (15:44 +1000)]
Merge remote-tracking branch 'hwspinlock/linux-next'

13 years agoMerge remote-tracking branch 'tmem/tmem'
Stephen Rothwell [Thu, 29 Sep 2011 05:39:35 +0000 (15:39 +1000)]
Merge remote-tracking branch 'tmem/tmem'

13 years agoMerge remote-tracking branch 'staging/staging-next'
Stephen Rothwell [Thu, 29 Sep 2011 05:35:34 +0000 (15:35 +1000)]
Merge remote-tracking branch 'staging/staging-next'

Conflicts:
drivers/misc/altera-stapl/altera.c
drivers/staging/comedi/drivers/ni_labpc.c
drivers/staging/rtl8192e/r8192E_core.c
drivers/staging/xgifb/XGI_main_26.c

13 years agoMerge remote-tracking branch 'usb/usb-next'
Stephen Rothwell [Thu, 29 Sep 2011 05:27:08 +0000 (15:27 +1000)]
Merge remote-tracking branch 'usb/usb-next'

13 years agoMerge remote-tracking branch 'tty/tty-next'
Stephen Rothwell [Thu, 29 Sep 2011 05:25:13 +0000 (15:25 +1000)]
Merge remote-tracking branch 'tty/tty-next'

Conflicts:
arch/powerpc/include/asm/udbg.h
arch/powerpc/kernel/udbg.c
drivers/tty/serial/8250.c

13 years agoMerge remote-tracking branch 'driver-core/driver-core-next'
Stephen Rothwell [Thu, 29 Sep 2011 05:18:42 +0000 (15:18 +1000)]
Merge remote-tracking branch 'driver-core/driver-core-next'

Conflicts:
arch/arm/plat-mxc/devices.c

13 years agoMerge commit 'refs/next/20110928/regmap'
Stephen Rothwell [Thu, 29 Sep 2011 05:15:30 +0000 (15:15 +1000)]
Merge commit 'refs/next/20110928/regmap'

Conflicts:
drivers/mfd/wm831x-spi.c

13 years agoMerge remote-tracking branch 'namespace/master'
Stephen Rothwell [Thu, 29 Sep 2011 05:01:32 +0000 (15:01 +1000)]
Merge remote-tracking branch 'namespace/master'

13 years agoMerge remote-tracking branch 'sysctl/master'
Stephen Rothwell [Thu, 29 Sep 2011 05:00:09 +0000 (15:00 +1000)]
Merge remote-tracking branch 'sysctl/master'

13 years agoMerge remote-tracking branch 'percpu/for-next'
Stephen Rothwell [Thu, 29 Sep 2011 04:58:39 +0000 (14:58 +1000)]
Merge remote-tracking branch 'percpu/for-next'

13 years agoMerge remote-tracking branch 'xen-two/linux-next'
Stephen Rothwell [Thu, 29 Sep 2011 04:57:17 +0000 (14:57 +1000)]
Merge remote-tracking branch 'xen-two/linux-next'

Conflicts:
arch/x86/xen/Kconfig

13 years agoMerge remote-tracking branch 'xen/upstream/xen'
Stephen Rothwell [Thu, 29 Sep 2011 04:51:42 +0000 (14:51 +1000)]
Merge remote-tracking branch 'xen/upstream/xen'

13 years agoMerge remote-tracking branch 'ptrace/ptrace'
Stephen Rothwell [Thu, 29 Sep 2011 04:45:41 +0000 (14:45 +1000)]
Merge remote-tracking branch 'ptrace/ptrace'

13 years agoMerge remote-tracking branch 'kvm/kvm-updates/3.2'
Stephen Rothwell [Thu, 29 Sep 2011 04:40:08 +0000 (14:40 +1000)]
Merge remote-tracking branch 'kvm/kvm-updates/3.2'

13 years agoMerge remote-tracking branch 'rcu/rcu/next'
Stephen Rothwell [Thu, 29 Sep 2011 04:33:41 +0000 (14:33 +1000)]
Merge remote-tracking branch 'rcu/rcu/next'

Conflicts:
arch/x86/kernel/cpu/mcheck/mce.c
arch/x86/kernel/process_64.c

13 years agoMerge remote-tracking branch 'tip/auto-latest'
Stephen Rothwell [Thu, 29 Sep 2011 04:27:03 +0000 (14:27 +1000)]
Merge remote-tracking branch 'tip/auto-latest'

Conflicts:
drivers/iommu/Makefile

13 years agoMerge remote-tracking branch 'gpio/gpio/next'
Stephen Rothwell [Thu, 29 Sep 2011 04:25:36 +0000 (14:25 +1000)]
Merge remote-tracking branch 'gpio/gpio/next'

13 years agoMerge remote-tracking branch 'spi/spi/next'
Stephen Rothwell [Thu, 29 Sep 2011 04:24:17 +0000 (14:24 +1000)]
Merge remote-tracking branch 'spi/spi/next'

13 years agoMerge remote-tracking branch 'devicetree/devicetree/next'
Stephen Rothwell [Thu, 29 Sep 2011 04:21:59 +0000 (14:21 +1000)]
Merge remote-tracking branch 'devicetree/devicetree/next'

13 years agoMerge remote-tracking branch 'edac-amd/for-next'
Stephen Rothwell [Thu, 29 Sep 2011 04:20:40 +0000 (14:20 +1000)]
Merge remote-tracking branch 'edac-amd/for-next'

13 years agoMerge remote-tracking branch 'edac/linux_next'
Stephen Rothwell [Thu, 29 Sep 2011 04:19:23 +0000 (14:19 +1000)]
Merge remote-tracking branch 'edac/linux_next'

Conflicts:
arch/x86/kernel/cpu/mcheck/mce.c

13 years agoMerge remote-tracking branch 'fsnotify/for-next'
Stephen Rothwell [Thu, 29 Sep 2011 04:16:30 +0000 (14:16 +1000)]
Merge remote-tracking branch 'fsnotify/for-next'

13 years agoMerge remote-tracking branch 'apm/for-next'
Stephen Rothwell [Thu, 29 Sep 2011 04:15:07 +0000 (14:15 +1000)]
Merge remote-tracking branch 'apm/for-next'

13 years agoMerge remote-tracking branch 'pm/linux-next'
Stephen Rothwell [Thu, 29 Sep 2011 04:08:47 +0000 (14:08 +1000)]
Merge remote-tracking branch 'pm/linux-next'

Conflicts:
arch/arm/mach-shmobile/board-ap4evb.c

13 years agoMerge remote-tracking branch 'trivial/for-next'
Stephen Rothwell [Thu, 29 Sep 2011 04:04:40 +0000 (14:04 +1000)]
Merge remote-tracking branch 'trivial/for-next'

Conflicts:
Documentation/PCI/pci.txt
arch/arm/mach-nuc93x/time.c
drivers/net/Kconfig

13 years agoMerge remote-tracking branch 'osd/linux-next'
Stephen Rothwell [Thu, 29 Sep 2011 04:01:00 +0000 (14:01 +1000)]
Merge remote-tracking branch 'osd/linux-next'

13 years agoMerge remote-tracking branch 'iommu/next'
Stephen Rothwell [Thu, 29 Sep 2011 03:59:35 +0000 (13:59 +1000)]
Merge remote-tracking branch 'iommu/next'

13 years agoMerge remote-tracking branch 'watchdog/master'
Stephen Rothwell [Thu, 29 Sep 2011 03:59:23 +0000 (13:59 +1000)]
Merge remote-tracking branch 'watchdog/master'

13 years agoMerge remote-tracking branch 'agp/agp-next'
Stephen Rothwell [Thu, 29 Sep 2011 03:58:42 +0000 (13:58 +1000)]
Merge remote-tracking branch 'agp/agp-next'

13 years agoMerge remote-tracking branch 'security/next'
Stephen Rothwell [Thu, 29 Sep 2011 03:52:11 +0000 (13:52 +1000)]
Merge remote-tracking branch 'security/next'

Conflicts:
fs/ocfs2/xattr.c

13 years agoMerge remote-tracking branch 'voltage/for-next'
Stephen Rothwell [Thu, 29 Sep 2011 03:50:47 +0000 (13:50 +1000)]
Merge remote-tracking branch 'voltage/for-next'

13 years agoMerge remote-tracking branch 'omap_dss2/for-next'
Stephen Rothwell [Thu, 29 Sep 2011 03:49:28 +0000 (13:49 +1000)]
Merge remote-tracking branch 'omap_dss2/for-next'

Conflicts:
arch/arm/mach-omap2/board-4430sdp.c
drivers/video/omap/lcd_apollon.c
drivers/video/omap/lcd_ldp.c
drivers/video/omap/lcd_overo.c

13 years agoMerge remote-tracking branch 'viafb/viafb-next'
Stephen Rothwell [Thu, 29 Sep 2011 03:47:32 +0000 (13:47 +1000)]
Merge remote-tracking branch 'viafb/viafb-next'

13 years agoMerge remote-tracking branch 'fbdev/fbdev-next'
Stephen Rothwell [Thu, 29 Sep 2011 03:46:09 +0000 (13:46 +1000)]
Merge remote-tracking branch 'fbdev/fbdev-next'

Conflicts:
drivers/video/Kconfig

13 years agoMerge remote-tracking branch 'mfd/for-next'
Stephen Rothwell [Thu, 29 Sep 2011 03:44:37 +0000 (13:44 +1000)]
Merge remote-tracking branch 'mfd/for-next'

Conflicts:
arch/arm/mach-u300/include/mach/irqs.h

13 years agoMerge remote-tracking branch 'md/for-next'
Stephen Rothwell [Thu, 29 Sep 2011 03:43:12 +0000 (13:43 +1000)]
Merge remote-tracking branch 'md/for-next'

13 years agoMerge remote-tracking branch 'slab/for-next'
Stephen Rothwell [Thu, 29 Sep 2011 03:36:48 +0000 (13:36 +1000)]
Merge remote-tracking branch 'slab/for-next'

13 years agoMerge remote-tracking branch 'kgdb/kgdb-next'
Stephen Rothwell [Thu, 29 Sep 2011 03:36:39 +0000 (13:36 +1000)]
Merge remote-tracking branch 'kgdb/kgdb-next'

13 years agoMerge remote-tracking branch 'mmc/mmc-next'
Stephen Rothwell [Thu, 29 Sep 2011 03:35:15 +0000 (13:35 +1000)]
Merge remote-tracking branch 'mmc/mmc-next'

Conflicts:
drivers/mmc/core/core.c
drivers/mmc/core/sd.c

13 years agoMerge remote-tracking branch 'leds/for-mm'
Stephen Rothwell [Thu, 29 Sep 2011 03:35:04 +0000 (13:35 +1000)]
Merge remote-tracking branch 'leds/for-mm'

Conflicts:
drivers/leds/Kconfig

13 years agoMerge remote-tracking branch 'battery/master'
Stephen Rothwell [Thu, 29 Sep 2011 03:33:16 +0000 (13:33 +1000)]
Merge remote-tracking branch 'battery/master'

13 years agoMerge branch 'quilt/device-mapper'
Stephen Rothwell [Thu, 29 Sep 2011 03:31:43 +0000 (13:31 +1000)]
Merge branch 'quilt/device-mapper'

13 years agoMerge remote-tracking branch 'block/for-next'
Stephen Rothwell [Thu, 29 Sep 2011 03:29:33 +0000 (13:29 +1000)]
Merge remote-tracking branch 'block/for-next'

13 years agoMerge remote-tracking branch 'input/next'
Stephen Rothwell [Thu, 29 Sep 2011 03:27:45 +0000 (13:27 +1000)]
Merge remote-tracking branch 'input/next'

13 years agoMerge branch 'quilt/rr'
Stephen Rothwell [Thu, 29 Sep 2011 03:26:26 +0000 (13:26 +1000)]
Merge branch 'quilt/rr'

13 years agoMerge remote-tracking branch 'cpufreq/next'
Stephen Rothwell [Thu, 29 Sep 2011 03:25:08 +0000 (13:25 +1000)]
Merge remote-tracking branch 'cpufreq/next'

13 years agoMerge remote-tracking branch 'sound-asoc/for-next'
Stephen Rothwell [Thu, 29 Sep 2011 03:23:44 +0000 (13:23 +1000)]
Merge remote-tracking branch 'sound-asoc/for-next'

13 years agoMerge remote-tracking branch 'sound/for-next'
Stephen Rothwell [Thu, 29 Sep 2011 03:21:41 +0000 (13:21 +1000)]
Merge remote-tracking branch 'sound/for-next'

Conflicts:
arch/mips/alchemy/devboards/db1x00/platform.c
sound/mips/Kconfig

13 years agoMerge remote-tracking branch 'crypto/master'
Stephen Rothwell [Thu, 29 Sep 2011 03:16:09 +0000 (13:16 +1000)]
Merge remote-tracking branch 'crypto/master'

13 years agoMerge remote-tracking branch 'l2-mtd/master'
Stephen Rothwell [Thu, 29 Sep 2011 03:14:50 +0000 (13:14 +1000)]
Merge remote-tracking branch 'l2-mtd/master'

Conflicts:
arch/arm/mach-at91/board-afeb-9260v1.c
arch/arm/mach-at91/board-neocore926.c
arch/arm/mach-at91/board-rm9200dk.c
arch/arm/mach-at91/board-sam9g20ek.c
arch/arm/mach-at91/board-sam9m10g45ek.c
arch/arm/mach-at91/board-usb-a9260.c

13 years agoMerge remote-tracking branch 'bluetooth/master'
Stephen Rothwell [Thu, 29 Sep 2011 02:48:57 +0000 (12:48 +1000)]
Merge remote-tracking branch 'bluetooth/master'

Conflicts:
net/bluetooth/hci_core.c
net/bluetooth/l2cap_core.c
net/bluetooth/mgmt.c
net/bluetooth/smp.c

13 years agoMerge remote-tracking branch 'wireless/master'
Stephen Rothwell [Thu, 29 Sep 2011 02:47:14 +0000 (12:47 +1000)]
Merge remote-tracking branch 'wireless/master'

Conflicts:
drivers/net/wireless/iwlwifi/iwl-pci.c
drivers/net/wireless/wl12xx/main.c

13 years agoMerge remote-tracking branch 'net/master'
Stephen Rothwell [Thu, 29 Sep 2011 02:41:21 +0000 (12:41 +1000)]
Merge remote-tracking branch 'net/master'

Conflicts:
arch/powerpc/configs/40x/hcu4_defconfig
drivers/net/wireless/iwlwifi/iwl-scan.c
drivers/s390/cio/qdio_main.c
net/batman-adv/soft-interface.c

13 years agoMerge remote-tracking branch 'slave-dma/next'
Stephen Rothwell [Thu, 29 Sep 2011 02:34:50 +0000 (12:34 +1000)]
Merge remote-tracking branch 'slave-dma/next'

13 years agoMerge remote-tracking branch 'scsi/master'
Stephen Rothwell [Thu, 29 Sep 2011 02:32:42 +0000 (12:32 +1000)]
Merge remote-tracking branch 'scsi/master'

13 years agoMerge remote-tracking branch 'ibft/master'
Stephen Rothwell [Thu, 29 Sep 2011 02:32:38 +0000 (12:32 +1000)]
Merge remote-tracking branch 'ibft/master'

13 years agoMerge remote-tracking branch 'swiotlb/master'
Stephen Rothwell [Thu, 29 Sep 2011 02:32:32 +0000 (12:32 +1000)]
Merge remote-tracking branch 'swiotlb/master'

13 years agoMerge remote-tracking branch 'ieee1394/for-next'
Stephen Rothwell [Thu, 29 Sep 2011 02:31:13 +0000 (12:31 +1000)]
Merge remote-tracking branch 'ieee1394/for-next'

13 years agoMerge remote-tracking branch 'infiniband/for-next'
Stephen Rothwell [Thu, 29 Sep 2011 02:29:51 +0000 (12:29 +1000)]
Merge remote-tracking branch 'infiniband/for-next'