id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
eebd2aa355692afaf9906f62118620f1a1c19dbb
Analyze and fix the following issue in the Linux kernel code: Pagecache zeroing: zero_user_segment, zero_user_segments and zero_user
Problem Details: Simplify page cache zeroing of segments of pages through 3 functions zero_user_segments(page, start1, end1, start2, end2) Zeros two segments of the page. It takes the position where to start and end the zeroing which avoids length calculations and makes code clearer. zero_user_segme...
```diff diff --git a/fs/buffer.c b/fs/buffer.c index 456c9ab7705b..1de921484eac 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -1798,7 +1798,7 @@ void page_zero_new_buffers(struct page *page, unsigned from, unsigned to) start = max(from, block_start); size = min(to, block_end) - start; - zero_user_page...
d2876d08d86f22ce1f276fc29f6baec8b53e32c6
Analyze and fix the following issue in the Linux kernel code: gpiolib: add gpio provider infrastructure
Problem Details: Provide new implementation infrastructure that platforms may choose to use when implementing the GPIO programming interface. Platforms can update their GPIO support to use this. In many cases the incremental cost to access a non-inlined GPIO should be less than a dozen instructions, with the memory c...
```diff diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index 369e4fc432e3..c3da03975d58 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -2,3 +2,5 @@ ccflags-$(CONFIG_DEBUG_GPIO) += -DDEBUG +obj-$(CONFIG_HAVE_GPIO_LIB) += gpiolib.o + diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/g...
7bbdc3d51cf793dd81c38f794f4cb73df58d1527
Analyze and fix the following issue in the Linux kernel code: serial: MPSC: set baudrate when BRG divider is set.
Problem Details: The clock to generate the desired baudrate with the MPSC is first divided by the Baud Rate Generator (BRG) and then by the MPSC itself. So, when the BRG divider is changed, the MPSC divider must also be changed to generate the correct baudrate. During MPSC initialization, the BRG divider is changed b...
```diff diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c index 4d643c926657..cb3a91967742 100644 --- a/drivers/serial/mpsc.c +++ b/drivers/serial/mpsc.c @@ -612,6 +612,7 @@ static void mpsc_hw_init(struct mpsc_port_info *pi) /* No preamble, 16x divider, low-latency, */ writel(0x04400400, pi->mpsc_base +...
74a197417240120d638d67d74f48655fb7f46f16
Analyze and fix the following issue in the Linux kernel code: 8250.c: support specifying DW APB UARTs in device platform_data
Problem Details: Allow the private_data field to be specified in platform_data for the standard 8250/16550 UART. This field is used by DW APB type UARTs and without this patch it's only possible to set this field when registering the port by hand. If private_data is not set then the driver will potentially oops with ...
```diff diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index f94109cbb46e..c93ef205aa2f 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -2662,16 +2662,17 @@ static int __devinit serial8250_probe(struct platform_device *dev) memset(&port, 0, sizeof(struct uart_port)); for (i = 0; p &&...
02c9b5cf9acd8a85313b892dc5196ccf133d4884
Analyze and fix the following issue in the Linux kernel code: serial: add ADDI-DATA GmbH Communication cardsin8250_pci.c and pci_ids.h
Problem Details: Add ADDI-DATA GmbH communication cards to 8250_pci driver. Supported cards are: APCI-7300, APCI-7420, APCI-7500, APCI-7800 APCI-7300-2, APCI-7420-2, APCI-7500-2 APCI-7300-3, APCI-7420-3, APCI-7500-3, APCI-7800-3 [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Krauth J. <krauth.julien@...
```diff diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c index ceb03c9e749f..0a4ac2b6eb5a 100644 --- a/drivers/serial/8250_pci.c +++ b/drivers/serial/8250_pci.c @@ -105,6 +105,32 @@ setup_port(struct serial_private *priv, struct uart_port *port, return 0; } +/* + * ADDI-DATA GmbH communication ca...
9ab9898e32971b938f9e8a997b12d0c4dd4832f7
Analyze and fix the following issue in the Linux kernel code: pcmcia/pcnet_cs: fix 'shadow variable' warning
Problem Details: Fixing: CHECK drivers/net/pcmcia/pcnet_cs.c drivers/net/pcmcia/pcnet_cs.c:523:15: warning: symbol 'hw_info' shadows an earlier one drivers/net/pcmcia/pcnet_cs.c:148:18: originally declared here Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se> Acked-by: Alan Cox <alan@redhat.com> Signed-of...
```diff diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index 6bc48a0673ca..6323988dfa1d 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c @@ -521,7 +521,7 @@ static int pcnet_config(struct pcmcia_device *link) int i, last_ret, last_fn, start_pg, stop_pg, cm_...
cfd4734c1e686164c87b9f31b67401cdf6f34238
Analyze and fix the following issue in the Linux kernel code: pcmcia/fmvj18x_cs: fix 'shadow variable' warning
Problem Details: Fixing: CHECK drivers/net/pcmcia/fmvj18x_cs.c drivers/net/pcmcia/fmvj18x_cs.c:1205:6: warning: symbol 'i' shadows an earlier one drivers/net/pcmcia/fmvj18x_cs.c:1179:9: originally declared here Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se> Acked-by: Alan Cox <alan@redhat.com> Signed-of...
```diff diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index 7cb22531082d..8f328a03847b 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c @@ -1198,8 +1198,7 @@ static void set_rx_mode(struct net_device *dev) outb(1, ioaddr + RX_MODE); /* Ignore almost a...
1569d9e89a77d51750497dc23d303e27d0d9494d
Analyze and fix the following issue in the Linux kernel code: pcmcia/3c574_cs: fix 'shadow variable' warning
Problem Details: Fixing: CHECK drivers/net/pcmcia/3c574_cs.c drivers/net/pcmcia/3c574_cs.c:695:7: warning: symbol 'i' shadows an earlier one drivers/net/pcmcia/3c574_cs.c:636:6: originally declared here Signed-off-by: Richard Knutson <ricknu-0@student.ltu.se> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: And...
```diff diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index dafbbdbc4bf7..3b78a3819bb3 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c @@ -696,7 +696,7 @@ static void tc574_reset(struct net_device *dev) mdio_write(ioaddr, lp->phys, 4, lp->advertising); if ...
7492d4a416d68ab4bd254b36ffcc4e0138daa8ff
Analyze and fix the following issue in the Linux kernel code: sdio: fix module device table definition for m68k
Problem Details: FATAL: drivers/bluetooth/btsdio: sizeof(struct sdio_device_id)=12 is not a modulo of the size of section __mod_sdio_device_table=30. Fix definition of struct sdio_device_id in mod_devicetable.h m68k has 16bit alignment for unsigned long. Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Sam Ravnborg ...
```diff diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index e9fddb42f26c..139d49d2f078 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -343,7 +343,8 @@ struct sdio_device_id { __u8 class; /* Standard interface or SDIO_ANY_ID */ __u16 vendor; ...
4d672e7ac79b5ec5cdc90e450823441e20464691
Analyze and fix the following issue in the Linux kernel code: timerfd: new timerfd API
Problem Details: This is the new timerfd API as it is implemented by the following patch: int timerfd_create(int clockid, int flags); int timerfd_settime(int ufd, int flags, const struct itimerspec *utmr, struct itimerspec *otmr); int timerfd_gettime(int ufd, struct itimerspec *otmr); The timerfd_create()...
```diff diff --git a/arch/alpha/kernel/systbls.S b/arch/alpha/kernel/systbls.S index 79de99e32c35..ba914af18c4f 100644 --- a/arch/alpha/kernel/systbls.S +++ b/arch/alpha/kernel/systbls.S @@ -495,7 +495,7 @@ sys_call_table: .quad sys_epoll_pwait .quad sys_utimensat /* 475 */ .quad sys_signalfd - .quad sys_timerf...
ed5d2cac114202fe2978a9cbcab8f5032796d538
Analyze and fix the following issue in the Linux kernel code: exec: rework the group exit and fix the race with kill
Problem Details: As Roland pointed out, we have the very old problem with exec. de_thread() sets SIGNAL_GROUP_EXIT, kills other threads, changes ->group_leader and then clears signal->flags. All signals (even fatal ones) sent in this window (which is not too small) will be lost. With this patch exec doesn't abuse SI...
```diff diff --git a/fs/exec.c b/fs/exec.c index 966c5c5b6741..be923e4bc389 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -760,7 +760,7 @@ static int de_thread(struct task_struct *tsk) */ read_lock(&tasklist_lock); spin_lock_irq(lock); - if (sig->flags & SIGNAL_GROUP_EXIT) { + if (signal_group_exit(sig)) { /* ...
198466b41d11dd062fb26ee0376080458d7bfcaf
Analyze and fix the following issue in the Linux kernel code: __group_complete_signal(): fix coredump with group stop race
Problem Details: When __group_complete_signal() sees sig_kernel_coredump() signal, it starts the group stop, but sets ->group_exit_task = t in a hope that "t" will actually dequeue this signal and invoke do_coredump(). However, by the time "t" enters get_signal_to_deliver() it is possible that the signal was blocked/i...
```diff diff --git a/kernel/signal.c b/kernel/signal.c index 4333b6dbb424..ea90c34e9348 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -911,27 +911,6 @@ __group_complete_signal(int sig, struct task_struct *p) } while_each_thread(p, t); return; } - - /* - * There will be a core dump. We make all th...
8a459e44ad837018ea5c34a9efe8eb4ad27ded26
Analyze and fix the following issue in the Linux kernel code: sys_remap_file_pages: fix ->vm_file accounting
Problem Details: Fix ->vm_file accounting, mmap_region() may do do_munmap(). Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/mm/fremap.c b/mm/fremap.c index 14bd3bf7826e..69a37c2bdf81 100644 --- a/mm/fremap.c +++ b/mm/fremap.c @@ -190,10 +190,13 @@ asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, */ if (mapping_cap_account_dirty(mapping)) { unsigned long addr; + struct file *file...
c0b49b0d164c4902e53c17d90e2c5e5a2ac9e132
Analyze and fix the following issue in the Linux kernel code: kvm: i386 fix
Problem Details: arch/x86/kvm/x86.c: In function 'emulator_cmpxchg_emulated': arch/x86/kvm/x86.c:1746: warning: passing argument 2 of 'vcpu->arch.mmu.gva_to_gpa' makes integer from pointer without a cast arch/x86/kvm/x86.c:1746: warning: 'addr' is used uninitialized in this function Is true. Local variable `addr' sha...
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 8f94a0b89dff..cf5308148689 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1739,7 +1739,7 @@ static int emulator_cmpxchg_emulated(unsigned long addr, if (bytes == 8) { gpa_t gpa; struct page *page; - char *addr; + char *kaddr; ...
c4b8e635f525441b9cb0bab428b527858d977e8f
Analyze and fix the following issue in the Linux kernel code: jbd2: Fix reference counting on the journal commit block's buffer head
Problem Details: With journal checksum patch we added asynchronous commits of journal commit headers, and accidentally dropped taking a reference on the buffer head. (Before the change, sync_dirty_buffer did the get_bh(). The associative put_bh is done by journal_wait_on_commit_record().) Signed-off-by: Aneesh Kumar ...
```diff diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index 48b3cb8aeb2e..d6ea623b1e23 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c @@ -136,7 +136,7 @@ static int journal_submit_commit_record(journal_t *journal, JBUFFER_TRACE(descriptor, "submit commit block"); lock_buffer(bh); - + get_bh(bh); set_bu...
ead03e30b050d6dda769e7e9b071c5fa720bf8d2
Analyze and fix the following issue in the Linux kernel code: [CIFS] fix warning in cifs_spnego.c
Problem Details: Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
```diff diff --git a/fs/cifs/cifs_spnego.c b/fs/cifs/cifs_spnego.c index d543accc10dd..6653e29637a7 100644 --- a/fs/cifs/cifs_spnego.c +++ b/fs/cifs/cifs_spnego.c @@ -125,7 +125,7 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo) #ifdef CONFIG_CIFS_DEBUG2 if (cifsFYI && !IS_ERR(spnego_key)) { struct cifs_spnego...
0189103c69f47712a0c542a8bc28ff46ebe53a8a
Analyze and fix the following issue in the Linux kernel code: [S390] Remove BUILD_BUG_ON() in vmem code.
Problem Details: Remove BUILD_BUG_ON() in vmem code since it causes build failures if the size of struct page increases. Instead calculate at compile time the address of the highest physical address that can be added to the 1:1 mapping. This supposed to fix a build failure with the page owner tracking leak detector pat...
```diff diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 72d20f70f8a6..29ae165d1749 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c @@ -528,7 +528,7 @@ static void __init setup_memory_end(void) memory_size = 0; memory_end &= PAGE_MASK; - max_mem = memory_end ? min(VMALLO...
e35e1fadb4585e3143fab34dd4f5070698b3305b
Analyze and fix the following issue in the Linux kernel code: [S390] sclp_tty/sclp_vt220: Fix scheduling while atomic
Problem Details: Under load the following bug message appeared while using sysrq-t: BUG: scheduling while atomic: bash/3662/0x00000004 0000000000105b74 000000003ba17740 0000000000000002 0000000000000000 000000003ba177e0 000000003ba17758 000000003ba17758 0000000000105bfe 0000000000817ba8 000000003f2a5350 ...
```diff diff --git a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c index e3b3d390b4a3..2e616e33891d 100644 --- a/drivers/s390/char/sclp_tty.c +++ b/drivers/s390/char/sclp_tty.c @@ -332,7 +332,7 @@ sclp_tty_write_string(const unsigned char *str, int count) if (sclp_ttybuf == NULL) { while (list_empt...
fe6b8e76d920b93fd445382aff7ff24082af8874
Analyze and fix the following issue in the Linux kernel code: [S390] dasd: fix panic caused by alias device offline
Problem Details: When an alias device is set offline while it is in use this may result in a panic in the cleanup part of the dasd_block_tasklet. The problem here is that there may exist some ccw requests that were originally created for the alias device and transferred to the base device when the alias was set offline...
```diff diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index ab4f64c49829..d984e0fae630 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -1706,7 +1706,7 @@ static void __dasd_cleanup_cqr(struct dasd_ccw_req *cqr) req = (struct request *) cqr->callback_data; dasd_profil...
67fe9251bba510572feb6c3357636148bbd17e30
Analyze and fix the following issue in the Linux kernel code: [S390] Implement ext2_find_next_bit.
Problem Details: Fixes this compile error: fs/ext4/mballoc.c: In function 'ext4_mb_generate_buddy': fs/ext4/mballoc.c:954: error: implicit declaration of function 'generic_find_next_le_bit' Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
```diff diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h index 95d93955a9bb..882db054110c 100644 --- a/include/asm-s390/bitops.h +++ b/include/asm-s390/bitops.h @@ -790,8 +790,6 @@ static inline int sched_find_first_bit(unsigned long *b) test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned lon...
b6b40c532a36f91df9c21caf9baba3b635e99d4e
Analyze and fix the following issue in the Linux kernel code: [S390] Define GENERIC_LOCKBREAK.
Problem Details: Fix compile error: CC arch/s390/kernel/asm-offsets.s In file included from arch/s390/kernel/asm-offsets.c:7: include/linux/sched.h: In function 'spin_needbreak': include/linux/sched.h:1931: error: implicit declaration of function '__raw_spin_is_contended' make[2]: *** [arch/s390/kernel/asm-offs...
```diff diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 82cbffd03654..f0e7ccf1b206 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -47,6 +47,11 @@ config NO_IOMEM config NO_DMA def_bool y +config GENERIC_LOCKBREAK + bool + default y + depends on SMP && PREEMPT + mainmenu "Linux Kernel Configura...
8c0933eeb701eb8f526d88b1915af7bb35748e7b
Analyze and fix the following issue in the Linux kernel code: [S390] console: allow vt220 console to be the only console
Problem Details: Fix console detection logic to support configurations in which the vt220 console is the only available Linux console. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
```diff diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 2d266f45e73f..72d20f70f8a6 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c @@ -145,7 +145,7 @@ __setup("condev=", condev_setup); static int __init conmode_setup(char *str) { -#if defined(CONFIG_SCLP_CONSOLE) +#if def...
2bc89b5ece48dc888734e8760ba5ad8566431912
Analyze and fix the following issue in the Linux kernel code: [S390] Fix couple of section mismatches.
Problem Details: Fix couple of section mismatches. And since we touch the code anyway change the IPL code to use C99 initializers. Cc: Michael Holzheu <holzheu@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
```diff diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S index 1a6dac8df6fb..6766e37fe8ea 100644 --- a/arch/s390/kernel/entry.S +++ b/arch/s390/kernel/entry.S @@ -11,6 +11,7 @@ #include <linux/sys.h> #include <linux/linkage.h> +#include <linux/init.h> #include <asm/cache.h> #include <asm/lowcore.h...
37c5f719e71882b759fa8acbdd11d5ca3a7965bb
Analyze and fix the following issue in the Linux kernel code: [S390] Fix smp_call_function_mask semantics.
Problem Details: Make sure func isn't called on the local cpu just like on all other architectures that implement this function. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
```diff diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index aa37fa154512..f5046fd4930f 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -225,12 +225,11 @@ EXPORT_SYMBOL(smp_call_function_single); * You must not call this function with disabled interrupts or from a * hardware interr...
a817a61f85c75181bde6c3d83ae11a24b089dd6a
Analyze and fix the following issue in the Linux kernel code: [S390] Fix linker script.
Problem Details: Fixes this warning: vmlinux: warning: allocated section `.text' not in segment Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
```diff diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S index 7d43c3cd3ef3..b4607155e8d0 100644 --- a/arch/s390/kernel/vmlinux.lds.S +++ b/arch/s390/kernel/vmlinux.lds.S @@ -35,7 +35,7 @@ SECTIONS KPROBES_TEXT *(.fixup) *(.gnu.warning) - } = 0x0700 + } :text = 0x0700 _etext = ....
b9c9a21a7c8faeff1d13a23d2c57a5d4b512cfa0
Analyze and fix the following issue in the Linux kernel code: [S390] cio: Clean up chsc response code handling.
Problem Details: This provides unified return codes for common response codes and also makes the debug feature messages more similar and informational. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
```diff diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index e7ba16a74ef7..007aaeb4f532 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c @@ -26,6 +26,25 @@ static void *sei_page; +static int chsc_error_from_response(int response) +{ + switch (response) { + case 0x0001: + return 0...
5d8c0aa9433b09387d9021358baef7939f9b32c4
Analyze and fix the following issue in the Linux kernel code: [INET]: Fix accidentally broken inet(6)_hash_connect's port offset calculations.
Problem Details: The port offset calculations depend on the protocol family, but, as Adrian noticed, I broke this logic with the commit 5ee31fc1ecdcbc234c8c56dcacef87c8e09909d8 [INET]: Consolidate inet(6)_hash_connect. Return this logic back, by passing the port offset directly into the consolidated function. Sign...
```diff diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 48ac620cb846..97dc35ad09be 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h @@ -389,7 +389,7 @@ static inline struct sock *inet_lookup(struct net *net, } extern int __inet_hash_connect(struct inet_...
2fa993423a345fd484f7295797ddb59b7738ad38
Analyze and fix the following issue in the Linux kernel code: drivers/bluetooth/btsdio.c: fix double-free
Problem Details: This patch fixes a double-free spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/bluetooth/btsdio.c b/drivers/bluetooth/btsdio.c index b786f6187902..58630cc1eff2 100644 --- a/drivers/bluetooth/btsdio.c +++ b/drivers/bluetooth/btsdio.c @@ -162,10 +162,8 @@ static int btsdio_rx_packet(struct btsdio_data *data) bt_cb(skb)->pkt_type = hdr[3]; err = hci_recv_frame(skb)...
cb7cd42930d4421780e78323f62243350ea14789
Analyze and fix the following issue in the Linux kernel code: drivers/bluetooth/bpa10x.c: fix memleak
Problem Details: This patch fixea a memleak spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c index 1375b5345a0a..3b28658f5a1f 100644 --- a/drivers/bluetooth/bpa10x.c +++ b/drivers/bluetooth/bpa10x.c @@ -423,6 +423,7 @@ static int bpa10x_send_frame(struct sk_buff *skb) break; default: + usb_free_urb(urb); return -EILSEQ; }...
a26af1e08a3a1e0f88e6f2685ac2313d713a59c9
Analyze and fix the following issue in the Linux kernel code: tun: impossible to deassert IFF_ONE_QUEUE or IFF_NO_PI
Problem Details: From: "Nathaniel Filardo" <nwfilardo@gmail.com> Taken from http://bugzilla.kernel.org/show_bug.cgi?id=9806 The TUN/TAP driver only permits one-way transitions of IFF_NO_PI or IFF_ONE_QUEUE during the lifetime of a tap/tun interface. Note that tun_set_iff contains 541 if (ifr->ifr_flags & I...
```diff diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 46339f6bcd00..038c1ef94d2e 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -529,9 +529,13 @@ static int tun_set_iff(struct file *file, struct ifreq *ifr) if (ifr->ifr_flags & IFF_NO_PI) tun->flags |= TUN_NO_PI; + else + tun->flags &= ~TU...
cd8d627a6b66d9755637b4dad2083864a9bfce9a
Analyze and fix the following issue in the Linux kernel code: hamradio: fix dmascc section mismatch
Problem Details: hw[] is used in both init and exit functions so it cannot be initdata (section mismatch is when CONFIG_MODULES=n and CONFIG_DMASCC=y). WARNING: vmlinux.o(.exit.text+0xba7): Section mismatch: reference to .init.data: (between 'dmascc_exit' and 'sixpack_exit_driver') Signed-off-by: Randy Dunlap <randy....
```diff diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c index 11b83dae00ac..e04bf9926441 100644 --- a/drivers/net/hamradio/dmascc.c +++ b/drivers/net/hamradio/dmascc.c @@ -262,8 +262,8 @@ static void tm_isr(struct scc_priv *priv); static int io[MAX_NUM_DEVS] __initdata = { 0, }; -/* Bewa...
7cc08b55fc476a9474e4dc9da41071b5dc2b406e
Analyze and fix the following issue in the Linux kernel code: [SCTP]: Fix kernel panic while received AUTH chunk with BAD shared key identifier
Problem Details: If SCTP-AUTH is enabled, received AUTH chunk with BAD shared key identifier will cause kernel panic. Test as following: step1: enabled /proc/sys/net/sctp/auth_enable step 2: connect to SCTP server with auth capable. Association is established between endpoints. Then send a AUTH chunk with a bad s...
```diff diff --git a/net/sctp/auth.c b/net/sctp/auth.c index 97e6ebd14500..ae367c82e512 100644 --- a/net/sctp/auth.c +++ b/net/sctp/auth.c @@ -420,15 +420,15 @@ struct sctp_shared_key *sctp_auth_get_shkey( const struct sctp_association *asoc, __u16 key_id) { - struct sctp_shared_key *key = NULL; + struct sct...
d2f19fa13ee5e78d4195a771f8f1ff7d42a80740
Analyze and fix the following issue in the Linux kernel code: [SCTP]: Fix kernel panic while received AUTH chunk while enabled auth
Problem Details: If STCP is started while /proc/sys/net/sctp/auth_enable is set 0 and association is established between endpoints. Then if /proc/sys/net/sctp/auth_enable is set 1, a received AUTH chunk will cause kernel panic. Test as following: step 1: echo 0> /proc/sys/net/sctp/auth_enable step 2: SCTP client ...
```diff diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 5df0c4bd415b..f98658782d4f 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -3865,6 +3865,10 @@ sctp_disposition_t sctp_sf_eat_auth(const struct sctp_endpoint *ep, struct sctp_chunk *err_chunk; sctp_ierror_t error; +...
4c6222587118f0776bdf40d498361d49572c58dd
Analyze and fix the following issue in the Linux kernel code: [SPARC64] pci_sun4v.c: Section fixes.
Problem Details: WARNING: vmlinux.o(.text+0x39be4): Section mismatch in reference from the function probe_existing_entries() to the function .init.text:page_in_phys_avail() Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@daveml...
```diff diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c index 1aa8e044b105..87c5cf572298 100644 --- a/arch/sparc64/kernel/pci_sun4v.c +++ b/arch/sparc64/kernel/pci_sun4v.c @@ -625,8 +625,8 @@ static void __init pci_sun4v_scan_bus(struct pci_pbm_info *pbm) /* XXX register error interrupt...
b9c4d82a853713d49ac53b507964d7cf30ee408d
Analyze and fix the following issue in the Linux kernel code: [IPV4]: Formatting fix for /proc/net/fib_trie.
Problem Details: The line in the /proc/net/fib_trie for route with TOS specified - has extra \n at the end - does not have a space after route scope like below. |-- 1.1.1.1 /32 universe UNICASTtos =1 Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft...
```diff diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 35851c96bdfb..f5fba3f71c06 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c @@ -2431,8 +2431,7 @@ static int fib_trie_seq_show(struct seq_file *seq, void *v) rtn_type(buf2, sizeof(buf2), fa->fa_type)); if (fa->fa_tos...
6de1a9104034a2c58db3abdaf03cddb507225137
Analyze and fix the following issue in the Linux kernel code: [IPV6]: Fix sysctl compilation error.
Problem Details: Move ipv6_icmp_sysctl_init and ipv6_route_sysctl_init into the right ifdef section otherwise that does not compile when CONFIG_SYSCTL=yes and CONFIG_PROC_FS=no Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com> Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <dave...
```diff diff --git a/include/net/ipv6.h b/include/net/ipv6.h index fa80ea48639d..c0c019f72ba9 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -110,7 +110,6 @@ struct frag_hdr { /* sysctls */ extern int sysctl_mld_max_msf; - extern struct ctl_path net_ipv6_ctl_path[]; #define _DEVINC(statname, modifi...
cc8274f50f2ad9a97a837451f63a0a3e65f7f490
Analyze and fix the following issue in the Linux kernel code: [IPV4]: Fix compile error building without CONFIG_FS_PROC
Problem Details: compile error building without CONFIG_FS_PROC: net/ipv4/fib_frontend.c: In function 'fib_net_init': net/ipv4/fib_frontend.c:1032: error: implicit declaration of function 'fib_proc_ init' net/ipv4/fib_frontend.c: In function 'fib_net_exit': net/ipv4/fib_frontend.c:1047: error: implicit declaration of f...
```diff diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 90d1175f63de..8b12667f7a2b 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h @@ -266,6 +266,14 @@ static inline void fib_res_put(struct fib_result *res) #ifdef CONFIG_PROC_FS extern int __net_init fib_proc_init(struct net *net); exter...
322c8a3c364ef4d9ead17e86890c19816b0e262f
Analyze and fix the following issue in the Linux kernel code: [IPSEC] xfrm4_beet_input(): fix an if()
Problem Details: A bug every C programmer makes at some point in time... Signed-off-by: Adrian Bunk <bunk@kernel.org> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv4/xfrm4_mode_beet.c b/net/ipv4/xfrm4_mode_beet.c index e093a7b59e18..b47030ba162b 100644 --- a/net/ipv4/xfrm4_mode_beet.c +++ b/net/ipv4/xfrm4_mode_beet.c @@ -102,7 +102,7 @@ static int xfrm4_beet_input(struct xfrm_state *x, struct sk_buff *skb) XFRM_MODE_SKB_CB(skb)->protocol = ph->nex...
9119f85a0cdbac0397b39fa198866bf530cfab8b
Analyze and fix the following issue in the Linux kernel code: [intel_agp] fix name for G35 chipset
Problem Details: Change origin chipset name i965G_1 to market name G35. Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
```diff diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index af7ff56b75d0..07141c914df1 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c @@ -14,8 +14,8 @@ #define PCI_DEVICE_ID_INTEL_E7221_IG 0x258a #define PCI_DEVICE_ID_INTEL_82946GZ_HB 0x2970 #define PCI_D...
4d64dd9e5d96cdcfa8dee91c7848341718c77444
Analyze and fix the following issue in the Linux kernel code: intel-agp: fixup resource handling in flush code.
Problem Details: The flush code resource handling was having problems where some BIOS reserve the resource in a pnp block and some don't. Also there was a bug in that configure was being called at resume and resetting some of the structs. Signed-off-by: Dave Airlie <airlied@linux.ie>
```diff diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index 6fa97ae6a126..af7ff56b75d0 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c @@ -126,6 +126,7 @@ static struct _intel_private { }; struct page *i8xx_page; struct resource ifp_resource; + int resource_...
1fa4db7d308da04f6644c5cb8eed244c200d4ed5
Analyze and fix the following issue in the Linux kernel code: fix AGP warning
Problem Details: drivers/char/agp/intel-agp.c: In function 'intel_i965_g33_setup_chipset_flush': drivers/char/agp/intel-agp.c:872: warning: right shift count >= width of type I wish the agp code wasn't written in a 10,000-column xterm :( Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Air...
```diff diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index ce75fa3a4723..8e61a0530485 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c @@ -861,7 +861,8 @@ static void intel_i965_g33_setup_chipset_flush(void) intel_alloc_chipset_flush_resource(); - pci_writ...
7bc531dd883b955e6198c8e202161f22d2e8c472
Analyze and fix the following issue in the Linux kernel code: IPoIB: Remove a misleading debug print
Problem Details: Commit 732a2170 ("IB/ipoib: Bound the net device to the ipoib_neigh structue") left a misleading debug print (n->dev would be a bond device only if boding is used). Clean it up. Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
```diff diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 886a08cc7d4a..09f5371137a1 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -814,11 +814,9 @@ static void ipoib_neigh_cleanup(struct neighbour *n) s...
0d89fe2c0ca12ad2ee4e35a0661319746af6e94a
Analyze and fix the following issue in the Linux kernel code: IB/mthca: Fix and simplify page size calculation in mthca_reg_phys_mr()
Problem Details: In mthca_reg_phys_mr(), we calculate the page size for the HCA hardware to use to map the buffer list passed in by the consumer. For example, if the consumer passes in [0] addr 0x1000, size 0x1000 [1] addr 0x2000, size 0x1000 then the algorithm would come up with a page size of 0x2000 and a l...
```diff diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c index 6bcde1cb9688..19b7f61cf04c 100644 --- a/drivers/infiniband/hw/mthca/mthca_provider.c +++ b/drivers/infiniband/hw/mthca/mthca_provider.c @@ -923,17 +923,13 @@ static struct ib_mr *mthca_reg_phys_mr(stru...
e8f9b2ed9882874ca96716597bd8c7113289e77b
Analyze and fix the following issue in the Linux kernel code: mlx4_core: Fix more section mismatches
Problem Details: Commit 3d73c288 ("mlx4_core: Fix section mismatches") fixed some of the section mismatches introduced when error recovery was added, but there were still more cases of errory recovery code calling into __devinit code from regular .text. Fix this by getting rid of the now-incorrect __devinit annotation...
```diff diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c index 89b3f0b7cdc0..a028d8a012ff 100644 --- a/drivers/net/mlx4/main.c +++ b/drivers/net/mlx4/main.c @@ -163,7 +163,7 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) return 0; } -static int __devinit mlx4_load_fw(s...
fe77efb8b7e80128b914044c175d5dcd75e9fff7
Analyze and fix the following issue in the Linux kernel code: [IA64] mca style cleanup
Problem Details: Unified changelog, 80 columns rule, and address form fix. Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
```diff diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index 6dbf5919d2d0..846e7e036b13 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c @@ -2,61 +2,69 @@ * File: mca.c * Purpose: Generic MCA handling layer * - * Updated for latest kernel * Copyright (C) 2003 Hewlett-Packard Co *...
965e7c8affeca27f7e5de75c97954e74d3b8052d
Analyze and fix the following issue in the Linux kernel code: [IA64] efi.c Spelling/punctuation fixes
Problem Details: Incorporates the suggestions from Peter Chubb the last time I submitted this. This called for using the same verb tense in the couple of preceding comments as well. Signed-off-by: Aron Griffis <aron@hp.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
```diff diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 9e5910920da6..269f4f4adfed 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c @@ -311,7 +311,7 @@ walk (efi_freemem_callback_t callback, void *arg, u64 attr) } /* - * Walks the EFI memory map and calls CALLBACK once for each EF...
7d9aed26ed11d7a472104b7078b0c5e4fd416059
Analyze and fix the following issue in the Linux kernel code: [IA64] Make efi.c mostly fit in 80 columns
Problem Details: This patch is purely whitespace changes to make the code fit in 80 columns, plus fix some inconsistent indentation. The efi_guidcmp() tests remain wider than 80-columns since that seems to be the most clear. Signed-off-by: Aron Griffis <aron@hp.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
```diff diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 242d79341120..9e5910920da6 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c @@ -1,7 +1,8 @@ /* * Extensible Firmware Interface * - * Based on Extensible Firmware Interface Specification version 0.9 April 30, 1999 + * Based o...
cdef24c9cd38ae236065409c4a6289f165639e55
Analyze and fix the following issue in the Linux kernel code: [IA64] aliasing-test: fix gcc warnings on non-ia64
Problem Details: Eliminate all build warnings. OK, these build warnings are from a build on x86_64. When I build on ia64, I don't see warnings. Now builds cleanly on ia64 and x86_64. Documentation/ia64/aliasing-test.c: In function 'map_mem': Documentation/ia64/aliasing-test.c:39: warning: implicit declaration of fu...
```diff diff --git a/Documentation/ia64/aliasing-test.c b/Documentation/ia64/aliasing-test.c index 773a814d4093..d23610fb2ff9 100644 --- a/Documentation/ia64/aliasing-test.c +++ b/Documentation/ia64/aliasing-test.c @@ -16,6 +16,7 @@ #include <fcntl.h> #include <fnmatch.h> #include <string.h> +#include <sys/ioctl.h> ...
97075c4b3b7fdd6a083eea075c3a4a601f0d64d8
Analyze and fix the following issue in the Linux kernel code: [IA64] Fix the order of atomic operations in restore_previous_kprobes on ia64
Problem Details: Fix the order of atomic operations to prevent overwriting prev_kprobe[0]. To pop values from stack, we must decrement stack index right AFTER reading values. Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
```diff diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c index fc4d2676264f..b618487cdc85 100644 --- a/arch/ia64/kernel/kprobes.c +++ b/arch/ia64/kernel/kprobes.c @@ -381,9 +381,10 @@ static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) static void __kprobes restore_previous_kprobe...
0df29025fd0379d5950d206314d0b10a2c8a9607
Analyze and fix the following issue in the Linux kernel code: [IA64] fix userspace compile error in gcc_intrin.h
Problem Details: Fixes userspace build errors when linux/ipv6.h is included such as in the dhcpv6 package under fedora. Likely causes other userspace build errors as well. I found this in akpm's tree from 2.6.18 but could not find any case of anyone proposing it for the main tree. Signed-off-by: Doug Chapman <doug.c...
```diff diff --git a/include/asm-ia64/gcc_intrin.h b/include/asm-ia64/gcc_intrin.h index 5b6665c754c9..de2ed2cbdd84 100644 --- a/include/asm-ia64/gcc_intrin.h +++ b/include/asm-ia64/gcc_intrin.h @@ -24,7 +24,9 @@ extern void ia64_bad_param_for_setreg (void); extern void ia64_bad_param_for_getreg (void); +#ifdef __K...
064287807c9dd64688084d34c6748a326b5f3ec8
Analyze and fix the following issue in the Linux kernel code: SLUB: Fix coding style violations
Problem Details: This fixes most of the obvious coding style violations in mm/slub.c as reported by checkpatch. Acked-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Christoph Lameter <clameter@sgi.com...
```diff diff --git a/mm/slub.c b/mm/slub.c index e160f28ab051..a660834416ac 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -357,22 +357,22 @@ static void print_section(char *text, u8 *addr, unsigned int length) printk(KERN_ERR "%8s 0x%p: ", text, addr + i); newline = 0; } - printk(" %02x", addr[i]); + printk(KE...
151c602f79cb9154c3f3d83223cae355af463d6f
Analyze and fix the following issue in the Linux kernel code: SLUB: Fix sysfs refcounting
Problem Details: If CONFIG_SYSFS is set then free the kmem_cache structure when sysfs tells us its okay. Otherwise there is the danger (as pointed out by Al Viro) that sysfs thinks the kobject still exists after kmem_cache_destroy() removed it. Signed-off-by: Christoph Lameter <clameter@sgi.com> Reviewed-by: Pekka J ...
```diff diff --git a/mm/slub.c b/mm/slub.c index 93f5c288f024..65bf21dc996a 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -247,7 +247,10 @@ static void sysfs_slab_remove(struct kmem_cache *); static inline int sysfs_slab_add(struct kmem_cache *s) { return 0; } static inline int sysfs_slab_alias(struct kmem_cache *s, cons...
e374d4835668a8c6aec7cefc0a44df69f9679017
Analyze and fix the following issue in the Linux kernel code: slub: fix shadowed variable sparse warnings
Problem Details: Introduce 'len' at outer level: mm/slub.c:3406:26: warning: symbol 'n' shadows an earlier one mm/slub.c:3393:6: originally declared here No need to declare new node: mm/slub.c:3501:7: warning: symbol 'node' shadows an earlier one mm/slub.c:3491:6: originally declared here No need to declare new x: mm...
```diff diff --git a/mm/slub.c b/mm/slub.c index 5cc4b7dddb50..93f5c288f024 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3390,7 +3390,7 @@ static void process_slab(struct loc_track *t, struct kmem_cache *s, static int list_locations(struct kmem_cache *s, char *buf, enum track_item alloc) { - int n = 0; + int len ...
c4057f5260650f165054bc56e16acc4aa0510d4f
Analyze and fix the following issue in the Linux kernel code: [ARM] 4819/1: RealView: Fix entry-macro.S to work with multiple platforms
Problem Details: This patch modifies the get_irqnr_preamble macro to work with multiple platforms at run-time by reading the address of the GIC controller from the gic_cpu_base_addr variable. This variable is defined in core.c and intialised in realview_eb.c (gic_init_irq). Signed-off-by: Catalin Marinas <catalin.mari...
```diff diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index 046d31ce27b0..29514ac94f34 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c @@ -50,6 +50,9 @@ #define REALVIEW_REFCOUNTER (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_24MHz_OFFSET) +/* used by ...
b21761ff18c0eba67e8f2886b3c0b9cae79b5249
Analyze and fix the following issue in the Linux kernel code: kbuild: Fix instrumentation removal breakage on avr32
Problem Details: AVR32 still includes Kconfig.instrumentation, so it won't build after this... Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Acked-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig index 0e56e96a17a7..c816f29154c9 100644 --- a/arch/avr32/Kconfig +++ b/arch/avr32/Kconfig @@ -235,8 +235,6 @@ source "drivers/Kconfig" source "fs/Kconfig" -source "kernel/Kconfig.instrumentation" - source "arch/avr32/Kconfig.debug" source "security/K...
2f98735c9c24ea1f0d40a364d4e63611b689b795
Analyze and fix the following issue in the Linux kernel code: vm audit: add VM_DONTEXPAND to mmap for drivers that need it
Problem Details: Drivers that register a ->fault handler, but do not range-check the offset argument, must set VM_DONTEXPAND in the vm_flags in order to prevent an expanding mremap from overflowing the resource. I've audited the tree and attempted to fix these problems (usually by adding VM_DONTEXPAND where it is not ...
```diff diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c index e8d50af58201..ef5e6b130c48 100644 --- a/drivers/char/drm/drm_vm.c +++ b/drivers/char/drm/drm_vm.c @@ -506,6 +506,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma) vma->vm_ops = &drm_vm_dma_ops; vma->vm_flags...
795d45b22c079946332bf3825afefe5a981a97b6
Analyze and fix the following issue in the Linux kernel code: x86: fix RTC lockdep warning: potential hardirq recursion
Problem Details: After disabling both CONFIG_DEBUG_LOCKING_API_SELFTESTS and netconsole (using current mainline) I get a login prompt, and also... [ 5.181668] SELinux: policy loaded with handle_unknown=deny [ 5.183315] type=1403 audit(1202100038.157:3): policy loaded auid=4294967295 ses=4294967295 [ 5.822073]...
```diff diff --git a/include/asm-generic/rtc.h b/include/asm-generic/rtc.h index d3238f1f70a6..dd1bed860e64 100644 --- a/include/asm-generic/rtc.h +++ b/include/asm-generic/rtc.h @@ -35,10 +35,11 @@ static inline unsigned char rtc_is_updating(void) { unsigned char uip; + unsigned long flags; - spin_lock_irq(&rtc_...
c2f71ee2140b2a506735ff9fcb7e3b1dfaab8f2b
Analyze and fix the following issue in the Linux kernel code: x86: add gbpages support to lookup_address
Problem Details: [ tglx@linutronix.de: fix bootup crash on sparse mappings. ] Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 9be684e61dcb..143fbafc948a 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -209,6 +209,11 @@ pte_t *lookup_address(unsigned long address, int *level) pud = pud_offset(pgd, address); if (pud_none(*pud)) return NULL; + +...
7bfb72e847c201fe32271fb13f75d060671d8890
Analyze and fix the following issue in the Linux kernel code: x86: fix page-present check in cpa_flush_range
Problem Details: pte_present() might return true for PROT_NONE mappings. Explicitely check the present bit. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 0b029c97174e..9be684e61dcb 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -119,7 +119,7 @@ static void cpa_flush_range(unsigned long start, int numpages, int cache) /* * Only flush present addresses: */ - if (pte...
07cf89c05f2bbafa002401ac4e09ac31678513e4
Analyze and fix the following issue in the Linux kernel code: x86: CPA fix pagetable split
Problem Details: Move the readout of the large entry into the spinlock section to prevent an unlikely but possible race. Mark the pmd/pud entry present after the split. We preserved the non present bit in the new split mapping. Remove the stale gfp_flags double initialization. Signed-off-by: Thomas Gleixner <tglx@li...
```diff diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 74446ea23ffb..72880993af89 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -336,7 +336,7 @@ out_unlock: static int split_large_page(pte_t *kpte, unsigned long address) { - pgprot_t ref_prot = pte_pgprot(pte_clrhuge(*kpte)...
31422c51e0dc72532d82e80895932d430c3ed307
Analyze and fix the following issue in the Linux kernel code: x86: rename LARGE_PAGE_SIZE to PMD_PAGE_SIZE
Problem Details: Fix up all users. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index 1ccb38a7f0d2..e8657b98c902 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S @@ -80,8 +80,8 @@ startup_32: #ifdef CONFIG_RELOCATABLE movl %ebp, %ebx - addl $(LARGE_PAGE_SIZE -1)...
9a14aefc1d28c6037122965ee8c10d92a970ade0
Analyze and fix the following issue in the Linux kernel code: x86: cpa, fix lookup_address
Problem Details: lookup_address() returns a wrong level and a wrong pointer to a non existing pte, when pmd or pud entries are marked !present. This happens for example due to boot time mapping of GART into the low memory space. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte...
```diff diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 3810f7a83b1d..7d21cd658ed3 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -188,6 +188,14 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address) return prot; } +/* + * Lookup the page table en...
34508f66b69ff1708192654f631eb8f1d4c52005
Analyze and fix the following issue in the Linux kernel code: x86: AMD Athlon X2 hard hang fix
Problem Details: An Athlon 64 X2 test system showed hard hangs shortly after marking the kernel text read-only, if we tried to preserve largepages and changed the PSE entry from RW to RO. The pagetable code itself is correct, it's the CPU that locked up hard (and not even the NMI watchdog could punch through that hard ...
```diff diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 40b7ac58e671..3810f7a83b1d 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -243,6 +243,17 @@ static int try_preserve_large_page(pte_t *kpte, unsigned long address, pgprot_t old_prot, new_prot; int level, res = CPA_SPLIT; ...
1c083eb2cbdd917149f6acaa55efca129d05c2a9
Analyze and fix the following issue in the Linux kernel code: x86: fix EFI mapping
Problem Details: The patch updates EFI runtime memory mapping code, by making EFI areas explicitly executable. Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/kernel/efi.c b/arch/x86/kernel/efi.c index 1411324a625c..32dd62b36ff7 100644 --- a/arch/x86/kernel/efi.c +++ b/arch/x86/kernel/efi.c @@ -379,11 +379,9 @@ void __init efi_init(void) #endif } -#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE) static void __init runtime_code_page_mke...
16c02ed74361433a4fc5d8bd5f67abbac6e1c5ca
Analyze and fix the following issue in the Linux kernel code: x86: add cpu mtrr init function definitions to mtrr.h
Problem Details: mtrr.h was included everywhere needed. Fixes the following sparse warnings. Also, the return types in the extern definitions were incorrect. arch/x86/kernel/cpu/mtrr/amd.c:113:12: warning: symbol 'amd_init_mtrr' was not declared. Should it be static? arch/x86/kernel/cpu/mtrr/cyrix.c:268:12: warning:...
```diff diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c index 822d8f90c1eb..1e27b69a7a0e 100644 --- a/arch/x86/kernel/cpu/mtrr/main.c +++ b/arch/x86/kernel/cpu/mtrr/main.c @@ -554,10 +554,6 @@ EXPORT_SYMBOL(mtrr_del); * These should be called implicitly, but we can't yet until all the i...
b6d549a2967881af4f02d02062acbfeb807d44b4
Analyze and fix the following issue in the Linux kernel code: x86: add cpu init function defintions to cpu.h
Problem Details: cpu.h was already included everywhere needed. Fixes following sparse warnings: arch/x86/kernel/cpu/amd.c:343:12: warning: symbol 'amd_init_cpu' was not declared. Should it be static? arch/x86/kernel/cpu/cyrix.c:444:12: warning: symbol 'cyrix_init_cpu' was not declared. Should it be static? arch/x86/k...
```diff diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index b7b2142b58e7..d9313d9adced 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -623,16 +623,6 @@ cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE; * They will insert themselves into the cpu_devs s...
7bb308a1eae2a3b869c498017aed15a699d80799
Analyze and fix the following issue in the Linux kernel code: x86: small sparse fix in process_32.c
Problem Details: arch/x86/kernel/process_32.c:254:43: warning: Using plain integer as NULL pointer Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 968371ab223a..dabdbeff1f77 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c @@ -251,7 +251,7 @@ void cpu_idle_wait(void) * because it has nothing to do. * Give all the remaining CPUS a kick. */...
73bdb73f6666228289af4be55a77e2ed978061a7
Analyze and fix the following issue in the Linux kernel code: x86: add include to cpu/intel.c
Problem Details: Fixes sparse warning: arch/x86/kernel/cpu/intel.c:48:15: warning: symbol 'ppro_with_ram_bug' was not declared. Should it be static? Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index d1c372b018db..fae31ce747bd 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -13,6 +13,7 @@ #include <asm/uaccess.h> #include <asm/ptrace.h> #include <asm/ds.h> +#include <asm/bugs.h> #include "cpu.h" ...
4cf31841762954ad2868156ccba94d798a16630f
Analyze and fix the following issue in the Linux kernel code: x86: mach-rdc321x Kconfig fix
Problem Details: The mach-rdc321x uses the leds-gpio driver and explicitely selects it, this driver also depends on the leds class module, select it as well. Signed-off-by: Florian Fainelli <florian.fainelli@telecomint.eu> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 7109037bdf7c..77198f49b383 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -309,6 +309,7 @@ config X86_RDC321X select M486 select X86_REBOOTFIXUPS select GENERIC_GPIO + select LEDS_CLASS select LEDS_GPIO help This option is needed for ...
3bc9a77e84096148d5ada29c986d6e71a20eaeda
Analyze and fix the following issue in the Linux kernel code: x86: rename module scx200_32 to scx200
Problem Details: The module scx200 were renamed to scx200_32 by the merge of the 32 and 64 bit x86 arch trees. Keep the _32 prefix on the .c file as it is 32 bit specific and fix the module name in the Makefile. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Ingo Mo...
```diff diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index f08063581804..21dc1a061bf1 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -75,7 +75,8 @@ ifdef CONFIG_INPUT_PCSPKR obj-y += pcspeaker.o endif -obj-$(CONFIG_SCx200) += scx200_32.o +obj-$(CONFIG_SCx200) += scx...
3a900d89db35c133bc0874e71d9156b22db362b4
Analyze and fix the following issue in the Linux kernel code: x86: restore correct module name for apm
Problem Details: The apm module were renamed to apm_32 during the merge of 32 and 64 bit x86 which is unfortunate. As apm is 32 bit specific we like to keep the _32 in the filename but the module should be named apm. Fix this in the Makefile. Reported-by: "A.E.Lawrence" <lawrence_a_e@ntlworld.com> Signed-off-by: Sam ...
```diff diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 6f813009d44b..f08063581804 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -37,7 +37,8 @@ obj-$(CONFIG_X86_MSR) += msr.o obj-$(CONFIG_X86_CPUID) += cpuid.o obj-$(CONFIG_MICROCODE) += microcode.o obj-$(CONFIG_PCI...
262d5ee27271703a0396d63649430f43f3b5deb3
Analyze and fix the following issue in the Linux kernel code: x86: VMI fix
Problem Details: Jeff Chua bisected down a vmware guest boot breakage (hang) to this paravirt change: commit 8d947344c47a40626730bb80d136d8daac9f2060 Author: Glauber de Oliveira Costa <gcosta@redhat.com> Date: Wed Jan 30 13:31:12 2008 +0100 x86: change write_idt_entry signature fix the off-by-one indexin...
```diff diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c index 4525bc2c2e19..12affe1f9bce 100644 --- a/arch/x86/kernel/vmi_32.c +++ b/arch/x86/kernel/vmi_32.c @@ -220,21 +220,21 @@ static void vmi_set_tr(void) static void vmi_write_idt_entry(gate_desc *dt, int entry, const gate_desc *g) { u32 *idt_e...
38cb47ba0187c481aa949d3bbf149e014e8cacda
Analyze and fix the following issue in the Linux kernel code: x86: relax RAM check in ioremap()
Problem Details: Kevin Winchester reported the loss of direct rendering, due to: [ 0.588184] agpgart: Detected AGP bridge 0 [ 0.588184] agpgart: unable to get memory for graphics translation table. [ 0.588184] agpgart: agp_backend_initialize() failed. [ 0.588207] agpgart-amd64: probe of 0000:00:00.0 failed...
```diff diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index c004d94608fd..1a88d1572a77 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -116,7 +116,7 @@ static void __iomem *__ioremap(unsigned long phys_addr, unsigned long size, { void __iomem *addr; struct vm_struct *area; - unsigned...
c9a28fa7b9ac19b676deefa0a171ce7df8755c08
Analyze and fix the following issue in the Linux kernel code: [ARM] 4798/1: pcm027: fix missing header file
Problem Details: This patch adds a PXA2xx specific header file to control chip setup. Without, the PCM027 BSP can't be built. Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
```diff diff --git a/arch/arm/mach-pxa/pcm027.c b/arch/arm/mach-pxa/pcm027.c index 540c3bba5f9a..c14696b9979d 100644 --- a/arch/arm/mach-pxa/pcm027.c +++ b/arch/arm/mach-pxa/pcm027.c @@ -29,6 +29,7 @@ #include <asm/mach/arch.h> #include <asm/arch/hardware.h> #include <asm/arch/pxa-regs.h> +#include <asm/arch/pxa2xx-...
6a0bd09dcd43ebca6ab73abcc2489bff824f7542
Analyze and fix the following issue in the Linux kernel code: [ARM] 4803/1: pxa: fix building issue of poodle.c caused by patch 4737/1
Problem Details: The is caused by the patch below: [ARM] 4737/1: Refactor corgi_lcd to improve readability + bugfix It renamed the confusing get_hsync_len() to get_hsync_invperiod(), which unfortunately leaves poodle.c un-modified. Signed-off-by: eric miao <eric.miao@marvell.com> Acked-by: Richard Purdie <rpurdie@...
```diff diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c index dd54496083cb..209eabf0ed3e 100644 --- a/arch/arm/mach-pxa/poodle.c +++ b/arch/arm/mach-pxa/poodle.c @@ -164,7 +164,7 @@ static struct resource poodlets_resources[] = { }, }; -static unsigned long poodle_get_hsync_len(void) +static u...
bb548dd43202b9109f551ca3da396d163ca7ddf3
Analyze and fix the following issue in the Linux kernel code: [ARM] 4801/1: pxa: fix building issues of missing pxa2xx-regs.h
Problem Details: Some machines are missing "pxa2xx-regs.h" due to the following patch: [ARM] pxa: move memory controller registers into pxa2xx-regs.h This patch fixes the issue by including the pxa2xx-regs.h where necessary. Signed-off-by: eric miao <eric.miao@marvell.com> Signed-off-by: Russell King <rmk+kernel@a...
```diff diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c index 28cfd71c032d..6012177a29a3 100644 --- a/arch/arm/mach-pxa/cm-x270.c +++ b/arch/arm/mach-pxa/cm-x270.c @@ -29,6 +29,7 @@ #include <asm/mach/map.h> #include <asm/arch/pxa-regs.h> +#include <asm/arch/pxa2xx-regs.h> #include <asm/arch...
cd5604d5618a802e4ed047eb8b1515edc5fc49b5
Analyze and fix the following issue in the Linux kernel code: [ARM] pxa: fix the warning of undeclared "struct pxaohci_platform_data"
Problem Details: The header file <asm/arch/ohci.h> was missing in the original file, include it to fix the warning. Signed-off-by: eric miao <eric.miao@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
```diff diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index 50ff453ad370..bfccb80ac8ef 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c @@ -10,6 +10,7 @@ #include <asm/arch/mmc.h> #include <asm/arch/irda.h> #include <asm/arch/i2c.h> +#include <asm/arch/ohci.h> #i...
a78de2f704a0954df011348c6022e0d49e773a44
Analyze and fix the following issue in the Linux kernel code: [ARM] 4802/1: Fix typo and remove vague comment
Problem Details: Fix typo and remove vague comment Signed-off-by: Marc Pignat <marc.pignat@hevs.ch> Acked-by: Andrew Victor <linux@maxim.org.za> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
```diff diff --git a/include/asm-arm/arch-at91/at91_mci.h b/include/asm-arm/arch-at91/at91_mci.h index c2e11cc374ba..1551fc24eb43 100644 --- a/include/asm-arm/arch-at91/at91_mci.h +++ b/include/asm-arm/arch-at91/at91_mci.h @@ -89,7 +89,7 @@ #define AT91_MCI_ENDRX (1 << 6) /* End of RX Buffer */ #define AT91_MCI_E...
e83aff58bf1b7e6b355a0cfa206e9d3aebe5623f
Analyze and fix the following issue in the Linux kernel code: [ARM] 4739/1: at91sam9263: make gpio bank C and D irqs work
Problem Details: On the at91sam9263, IRQs for GPIO banks C and D don't currently work. This is because banks C, D, and E share one clock and toplevel IRQ, but the AT91 code setting up and handling GPIO IRQs expects no sharing. This patch: - Fixes GPIO IRQ setup and handling to cope with GPIO banks that are shared ...
```diff diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h index b5daf7f5e011..7b9ce7a336b0 100644 --- a/arch/arm/mach-at91/generic.h +++ b/arch/arm/mach-at91/generic.h @@ -47,6 +47,9 @@ extern void at91_irq_resume(void); #define AT91RM9200_BGA 4 /* AT91RM9200 BGA package has 4 banks */ struc...
85e6c7a7dbdb18a93846073a7f01369e91665c53
Analyze and fix the following issue in the Linux kernel code: [ARM] 4810/1: - Fix 'section mismatch' building warnings
Problem Details: Warning message : WARNING: vmlinux.o(.text+0x9afc): Section mismatch: reference to .init.text:sa1110_mb_enable (between 'sa1111_probe' and 'sa1111_remove') WARNING: vmlinux.o(.text+0x13b1ac): Section mismatch: reference to .init.text:pcmcia_jornada720_init (between 'pcmcia_probe' and 'pcmcia_remove') ...
```diff diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c index 9e13c8358ea7..5c84c604ed86 100644 --- a/arch/arm/mach-sa1100/generic.c +++ b/arch/arm/mach-sa1100/generic.c @@ -470,7 +470,7 @@ void __init sa1110_mb_disable(void) * If the system is going to use the SA-1111 DMA engines, set up...
66a2c077c36ee5c56e77ba3757702c4464011da6
Analyze and fix the following issue in the Linux kernel code: [ARM] xtime_seqlock: fix more ARM machines for xtime deadlocking
Problem Details: move update_process_times() out from under xtime_lock. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
```diff diff --git a/arch/arm/common/time-acorn.c b/arch/arm/common/time-acorn.c index 34038eccbba9..d544da414731 100644 --- a/arch/arm/common/time-acorn.c +++ b/arch/arm/common/time-acorn.c @@ -69,9 +69,7 @@ void __init ioctime_init(void) static irqreturn_t ioc_timer_interrupt(int irq, void *dev_id) { - write_seqlo...
2f65baff3ab546d011b0e3f944eccd1ec5816d5d
Analyze and fix the following issue in the Linux kernel code: [ARM] 21285 serial: fix build error
Problem Details: drivers/serial/21285.c: In function 'serial21285_set_termios': drivers/serial/21285.c:280: error: 'tty' undeclared (first use in this function) drivers/serial/21285.c:280: error: (Each undeclared identifier is reported only once drivers/serial/21285.c:280: error: for each function it appears in.) Sign...
```diff diff --git a/drivers/serial/21285.c b/drivers/serial/21285.c index 6a48dfa1efe8..0276471cb25e 100644 --- a/drivers/serial/21285.c +++ b/drivers/serial/21285.c @@ -237,6 +237,12 @@ serial21285_set_termios(struct uart_port *port, struct ktermios *termios, baud = uart_get_baud_rate(port, termios, old, 0, port->u...
d50ed907dc3db5bf2dd0a05b4e199a65793a3788
Analyze and fix the following issue in the Linux kernel code: virtio_blk: implement naming for vda-vdz,vdaa-vdzz,vdaaa-vdzzz
Problem Details: Am Freitag, 1. Februar 2008 schrieb Christian Borntraeger: > Right. I will fix that with an additional patch. This patch goes on top of the minor number patch. Please let me know if you want a merged patch: Currently virtio_blk creates the disk name combinging "vd" with 'a'++. This will give strange...
```diff diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 559c322c4ffa..3b1a68d6eddb 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -9,8 +9,7 @@ #define VIRTIO_MAX_SG (3+MAX_PHYS_SEGMENTS) #define PART_BITS 4 -static unsigned char virtblk_index = 'a'; -static in...
2cb9c6bafc58cf4066cb15f0ac6989a1015a02cc
Analyze and fix the following issue in the Linux kernel code: virtio: free transmit skbs when notified, not on next xmit.
Problem Details: This fixes a potential dangling xmit problem. We also suppress refill interrupts until we need them. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
```diff diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index bd4d26a36ead..a61c176607f4 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -56,11 +56,13 @@ static inline void vnet_hdr_to_sg(struct scatterlist *sg, struct sk_buff *skb) sg_init_one(sg, skb_vnet_hdr(skb), sizeof(st...
a48bd8f67003c342e147309a331f656a5e75a5e4
Analyze and fix the following issue in the Linux kernel code: virtio: flush buffers on open
Problem Details: Fix bug found by Christian Borntraeger: if the other side fills all the registered network buffers before we enable NAPI, we will never get an interrupt. The simplest fix is to process the input queue once on open. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
```diff diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index be5688f5e931..bd4d26a36ead 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -283,6 +283,13 @@ static int virtnet_open(struct net_device *dev) struct virtnet_info *vi = netdev_priv(dev); napi_enable(&vi->napi); + ...
50c8ea8080700014872f2bbd7466d31ce0476290
Analyze and fix the following issue in the Linux kernel code: virtio: Net header needs hdr_len
Problem Details: It's far easier to deal with packets if we don't have to parse the packet to figure out the header length to know how much to pull into the skb data. Add the field to the virtio_net_hdr struct (and fix the spaces that somehow crept in there). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
```diff diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 7b0059f0f5d4..3492ae0951de 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -242,6 +242,7 @@ static int start_xmit(struct sk_buff *skb, struct net_device *dev) } if (skb_is_gso(skb)) { + hdr->hdr_len = skb_trans...
3309daaad724dd08eb598bf9c12b7bb9daddd706
Analyze and fix the following issue in the Linux kernel code: virtio: Fix vring_init/vring_size to take unsigned long
Problem Details: Using unsigned int resulted in silent truncation of the upper 32-bit on x86_64 resulting in an OOPS since the ring was being initialized wrong. Please reconsider my previous patch to just use PAGE_ALIGN(). Open coding this sort of stuff, no matter how simple it seems, is just asking for this sort of ...
```diff diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 8cde10e792c4..ea3be89a0e83 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -89,7 +89,7 @@ struct vring { * }; */ static inline void vring_init(struct vring *vr, unsigned int num, void *p, - un...
cb79f1998d89821a4dbac47f59a46ee3fbbf3c61
Analyze and fix the following issue in the Linux kernel code: dlm: dlm/user.c input validation fixes
Problem Details: a) in device_write(): add sentinel NUL byte, making sure that lspace.name will be NUL-terminated b) in compat_input() be keep it simple about the amounts of data we are copying. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
```diff diff --git a/fs/dlm/user.c b/fs/dlm/user.c index 7cbc6826239b..c3060458b68e 100644 --- a/fs/dlm/user.c +++ b/fs/dlm/user.c @@ -82,7 +82,7 @@ struct dlm_lock_result32 { static void compat_input(struct dlm_write_request *kb, struct dlm_write_request32 *kb32, - int max_namelen) + size_t count) { k...
043b19cdc081f586a8f4e1c93ce6c03b63c26284
Analyze and fix the following issue in the Linux kernel code: dlm: fix dlm_dir_lookup() handling of too long names
Problem Details: ... those can happen and BUG() from DLM_ASSERT() in allocate_direntry() is not a good way to handle them. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
```diff diff --git a/fs/dlm/dir.c b/fs/dlm/dir.c index 831050e5bfd5..85defeb64df4 100644 --- a/fs/dlm/dir.c +++ b/fs/dlm/dir.c @@ -319,6 +319,9 @@ static int get_entry(struct dlm_ls *ls, int nodeid, char *name, write_unlock(&ls->ls_dirtbl[bucket].lock); + if (namelen > DLM_RESNAME_MAXLEN) + return -EINVAL; + d...
a9cc9159281d44754f621f75d4efad0076b29db4
Analyze and fix the following issue in the Linux kernel code: dlm: fix overflows when copying from ->m_extra to lvb
Problem Details: Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
```diff diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 6d98cf9d043d..5b82187e0221 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -1226,6 +1226,8 @@ static void set_lvb_lock_pc(struct dlm_rsb *r, struct dlm_lkb *lkb, b = dlm_lvb_operations[lkb->lkb_grmode + 1][lkb->lkb_rqmode + 1]; if (b == 1) { int len = re...
ef58bccab7c7ef34451aa4ceea39545ef126b666
Analyze and fix the following issue in the Linux kernel code: dlm: make find_rsb() fail gracefully when namelen is too large
Problem Details: We *can* get there from receive_request() and dlm_recover_master_copy() with namelen too large if incoming request is invalid; BUG() from DLM_ASSERT() in allocate_rsb() is a bit excessive reaction to that and in case of dlm_recover_master_copy() we would actually oops before that while calculating hash...
```diff diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 0593dd81d46d..6d98cf9d043d 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -436,11 +436,15 @@ static int find_rsb(struct dlm_ls *ls, char *name, int namelen, { struct dlm_rsb *r, *tmp; uint32_t hash, bucket; - int error = 0; + int error = -EINVAL; + + if (...
a5dd06313dbcec3a2c8a5e4a6f3ddb2a8fc72ec9
Analyze and fix the following issue in the Linux kernel code: dlm: receive_rcom_lock_args() overflow check
Problem Details: Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
```diff diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 6c605fc10613..0593dd81d46d 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -4271,7 +4271,6 @@ static int receive_rcom_lock_args(struct dlm_ls *ls, struct dlm_lkb *lkb, struct dlm_rsb *r, struct dlm_rcom *rc) { struct rcom_lock *rl = (struct rcom_lock ...
eef7d739c218cb2546cf95686db77de0d76e4122
Analyze and fix the following issue in the Linux kernel code: dlm: dlm_process_incoming_buffer() fixes
Problem Details: * check that length is large enough to cover the non-variable part of message or rcom resp. (after checking that it's large enough to cover the header, of course). * kill more pointless casts Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
```diff diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h index ec61bbaf25df..65499ceaa516 100644 --- a/fs/dlm/dlm_internal.h +++ b/fs/dlm/dlm_internal.h @@ -403,6 +403,12 @@ struct dlm_rcom { char rc_buf[0]; }; +union dlm_packet { + struct dlm_header header; /* common to other two */ + struct dlm_mess...
8b0d8e03f847d9c1677b8a193cd124debbc54633
Analyze and fix the following issue in the Linux kernel code: dlm: use proper C for dlm/requestqueue stuff (and fix alignment bug)
Problem Details: a) don't cast the pointer to dlm_header *, we use it as dlm_message * anyway. b) we copy the message into a queue element, then pass the pointer to copy to dlm_receive_message_saved(); declare it properly to make sure that we have the right alignment. Signed-off-by: Al Viro <viro@zeniv.linux....
```diff diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index ff4a198fa677..d9f07a42e3cf 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -3802,7 +3802,7 @@ static void dlm_receive_message(struct dlm_ls *ls, struct dlm_message *ms, int nodeid) { if (dlm_locking_stopped(ls)) { - dlm_add_requestqueue(ls, nodeid, (st...
b533184fc353d4a2d07929b4ac424a6f1bf5a3b9
Analyze and fix the following issue in the Linux kernel code: locks: clarify posix_locks_deadlock
Problem Details: For such a short function (with such a long comment), posix_locks_deadlock() seems to cause a lot of confusion. Attempt to make it a bit clearer: - Remove the initial posix_same_owner() check, which can never pass (since this is only called in the case that block_fl and caller_fl conflict) - ...
```diff diff --git a/fs/locks.c b/fs/locks.c index 8b8388eca05e..c3eecb895acf 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -683,45 +683,55 @@ posix_test_lock(struct file *filp, struct file_lock *fl) EXPORT_SYMBOL(posix_test_lock); -/* This function tests for deadlock condition before putting a process to - * sleep....
8891fec65ac5b5a74b50c705e31b66c92c3eddeb
Analyze and fix the following issue in the Linux kernel code: scsi: fix dependency bug in aic7 Makefile
Problem Details: Building the aic7xxx driver includes the copy of an .h file from a _shipped file. In a highly parallel build Ingo saw that the build sometimes failed (included distcc usage). It was tracked down to a missing dependency from the .c source file to the generated .h file. We started to build the .c file b...
```diff diff --git a/drivers/scsi/aic7xxx/Makefile b/drivers/scsi/aic7xxx/Makefile index e4f70c563bc2..4c549540a35d 100644 --- a/drivers/scsi/aic7xxx/Makefile +++ b/drivers/scsi/aic7xxx/Makefile @@ -44,13 +44,8 @@ clean-files += aic79xx_seq.h aic79xx_reg.h aic79xx_reg_print.c # Dependencies for generated files need ...
09c6dd3c9d99b63608dc77dc462d4a5a3785f620
Analyze and fix the following issue in the Linux kernel code: fs/binfmt_elf.c: spello fix
Problem Details: s/litle/little Signed-off-by: Ohad Ben-Cohen <ohad@bencohen.org> Signed-off-by: Adrian Bunk <bunk@kernel.org>
```diff diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 18ed6dd906c1..4628c42ca892 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -117,7 +117,7 @@ static int padzero(unsigned long elf_bss) return 0; } -/* Let's use some macros to make this stack manipulation a litle clearer */ +/* Let's use some macros...
28bc44d7d1d967b8251214dd7a130d523b5ba5ee
Analyze and fix the following issue in the Linux kernel code: do_invalidatepage() comment typo fix
Problem Details: Fix a typo in the comment for do_invalidatepage(). Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn> Signed-off-by: Adrian Bunk <bunk@kernel.org>
```diff diff --git a/mm/truncate.c b/mm/truncate.c index cadc15653dde..c3123b08ff6d 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -21,7 +21,7 @@ /** - * do_invalidatepage - invalidate part of all of a page + * do_invalidatepage - invalidate part or all of a page * @page: the page which is affected * @offse...
3eb43f689cef73c7c62bcaf90d7dc75a6182d2bd
Analyze and fix the following issue in the Linux kernel code: Documentation/filesystems/porting fixes
Problem Details: typo fix and whitespace cleanup Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com> Signed-off-by: Adrian Bunk <bunk@kernel.org>
```diff diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting index dac45c92d872..0f33c77bc14b 100644 --- a/Documentation/filesystems/porting +++ b/Documentation/filesystems/porting @@ -1,6 +1,6 @@ Changes since 2.5.0: ---- +--- [recommended] New helpers: sb_bread(), sb_getblk(), sb...
53379e57a7705e2946c8d77d09a57a169097a6fe
Analyze and fix the following issue in the Linux kernel code: typo fixes in net/core/net_namespace.c
Problem Details: Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com> Signed-off-by: Adrian Bunk <bunk@kernel.org>
```diff diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 26e941d912e8..7b660834a4c2 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -287,7 +287,7 @@ EXPORT_SYMBOL_GPL(register_pernet_subsys); * @ops: pernet operations structure to manipulate * * Remove the pernet oper...