id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
411fc6bcef54f828a5458f4730c68abdf13c6bf0
Analyze and fix the following issue in the Linux kernel code: Btrfs: Fix variables set but not read (bugs found by gcc 4.6)
Problem Details: These are all the cases where a variable is set, but not read which are really bugs. - Couple of incorrect error handling fixed. - One incorrect use of a allocation policy - Some other things Still needs more review. Found by gcc 4.6's new warnings. [akpm@linux-foundation.org: fix build. Might hav...
```diff diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c index e9103b3baa49..f0cad5ae5be7 100644 --- a/fs/btrfs/dir-item.c +++ b/fs/btrfs/dir-item.c @@ -427,5 +427,5 @@ int btrfs_delete_one_dir_name(struct btrfs_trans_handle *trans, ret = btrfs_truncate_item(trans, root, path, item_len - sub_item_len, ...
45f81b1c96d9793e47ce925d257ea693ce0b193e
Analyze and fix the following issue in the Linux kernel code: jump label: Add work around to i386 gcc asm goto bug
Problem Details: On i386 (not x86_64) early implementations of gcc would have a bug with asm goto causing it to produce code like the following: (This was noticed by Peter Zijlstra) 56 pushl 0 67 nopl jmp 0x6f popl jmp 0x8c 6f mov test j...
```diff diff --git a/arch/Kconfig b/arch/Kconfig index 53d7f619a1b9..8bf0fa652eb6 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -42,6 +42,20 @@ config KPROBES for kernel debugging, non-intrusive instrumentation and testing. If in doubt, say "N". +config JUMP_LABEL + bool "Optimize trace point call sit...
9f2a0fac625bcef9c579bcf0b0c904ab1a56e7c4
Analyze and fix the following issue in the Linux kernel code: b43: Fix warning at drivers/mmc/core/core.c:237 in mmc_wait_for_cmd
Problem Details: On module removal, the sdio version of b43 generates the following warning: [ 851.560519] ------------[ cut here ]------------ [ 851.560531] WARNING: at drivers/mmc/core/core.c:237 mmc_wait_for_cmd+0x88/0x90() [ 851.560534] Hardware name: 20552PG [ 851.560536] Modules linked in: b43(-) ssb mmc_blo...
```diff diff --git a/drivers/net/wireless/b43/sdio.c b/drivers/net/wireless/b43/sdio.c index 45933cf8e8c2..9a55338d957f 100644 --- a/drivers/net/wireless/b43/sdio.c +++ b/drivers/net/wireless/b43/sdio.c @@ -175,7 +175,9 @@ static void b43_sdio_remove(struct sdio_func *func) struct b43_sdio *sdio = sdio_get_drvdata(fu...
520efd1ace3f826120482e57a95d649b4e1c1684
Analyze and fix the following issue in the Linux kernel code: mac80211: fix failure to check kmalloc return value in key_key_read
Problem Details: I noticed two small issues in mac80211/debugfs_key.c::key_key_read while reading through the code. Patch below. The key_key_read() function returns ssize_t and the value that's actually returned is the return value of simple_read_from_buffer() which also returns ssize_t, so let's hold the return value...
```diff diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c index 4aa47d074a79..1243d1db5c59 100644 --- a/net/mac80211/debugfs_key.c +++ b/net/mac80211/debugfs_key.c @@ -203,9 +203,13 @@ static ssize_t key_key_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { struct...
731b2034999bbfe86c9074f1b0d611940bf7c323
Analyze and fix the following issue in the Linux kernel code: libertas: Fix sd8686 firmware reload
Problem Details: For the SD8686, we cannot rely on the scratch register to read the firmware load status, because the same register is used for storing RX packet length. Broaden the check to account for this. The module can now be unloaded/reloaded successfully. Based on the implementation from libertas_tf. Signed-o...
```diff diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c index 296fd00a5129..e5685dc317a8 100644 --- a/drivers/net/wireless/libertas/if_sdio.c +++ b/drivers/net/wireless/libertas/if_sdio.c @@ -684,18 +684,40 @@ static int if_sdio_prog_firmware(struct if_sdio_card *card) ...
4fc4fbd1d9a05fa4f348b499aca3a6f8d3c9bbe6
Analyze and fix the following issue in the Linux kernel code: ath9k: Fix incorrect access of rate flags in RC
Problem Details: The index variable to access the rate flags should be obtained from the inner loop counter which corresponds to the rate table structure.This fixes the invalid rate selection i.e when the supported basic rate is invalid on a particular band and also the following warning message. Thanks to Raj for find...
```diff diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index 0cee90cf8dc9..89978d71617f 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c @@ -527,7 +527,7 @@ static u8 ath_rc_setvalid_rates(struct ath_rate_priv *ath_rc_priv, for (i = 0; ...
4dacd5c073150cd78dfb6004cbfa71986f0258a4
Analyze and fix the following issue in the Linux kernel code: kgdbts: prevent re-entry to kgdbts before it unregisters
Problem Details: The "kgdb_connected" variable of debug_core just indicates whether or not kgdbts is connected to the debug_core. It does not completely prevent a script from trying invoke kgdbts again and possibly crashing the system (see Call Trace below). The configured variable in kgtbts can be used instead of kg...
```diff diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c index 72450237a0f4..59c118c19a91 100644 --- a/drivers/misc/kgdbts.c +++ b/drivers/misc/kgdbts.c @@ -1044,12 +1044,6 @@ static int __init init_kgdbts(void) return configure_kgdbts(); } -static void cleanup_kgdbts(void) -{ - if (configured == 1) - k...
d7ba979d45272385ce0fdf141d922e61ff48e07b
Analyze and fix the following issue in the Linux kernel code: debug_core,x86,blackfin: Clean up hw debug disable API
Problem Details: The kgdb_disable_hw_debug() was an architecture specific function for disabling all hardware breakpoints on a per cpu basis when entering the debug core. This patch will remove the weak function kdbg_disable_hw_debug() and change it into a call back which lives with the rest of hw breakpoint call back...
```diff diff --git a/arch/blackfin/kernel/kgdb.c b/arch/blackfin/kernel/kgdb.c index 08bc44ea6883..edae461b1c54 100644 --- a/arch/blackfin/kernel/kgdb.c +++ b/arch/blackfin/kernel/kgdb.c @@ -320,7 +320,7 @@ static void bfin_correct_hw_break(void) } } -void kgdb_disable_hw_debug(struct pt_regs *regs) +static void b...
578bd4dfcda63d2ef15f025f1d5d55c0e56b9660
Analyze and fix the following issue in the Linux kernel code: kdb: Fix early debugging crash regression
Problem Details: The kdb_current legally be equal to NULL in the early boot of the x86 arch. The problem pcan be observed by booting with the kernel arguments: earlyprintk=vga ekgdboc=kbd kgdbwait The kdb shell will oops on entry and recursively fault because it cannot get past the final stage of shell initializ...
```diff diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index 9755ac05e446..37755d621924 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c @@ -1127,7 +1127,7 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, /* special case below */ } else...
834b2964b7ab047610da038e42d61dc8dac6339a
Analyze and fix the following issue in the Linux kernel code: kgdb,arm: fix register dump
Problem Details: DBG_MAX_REG_NUM incorrectly had the number of indices in the GDB regs array rather than the number of registers, leading to an oops when the "rd" command is used in KDB. Cc: stable@kernel.org Signed-off-by: Rabin Vincent <rabin@rab.in> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
```diff diff --git a/arch/arm/include/asm/kgdb.h b/arch/arm/include/asm/kgdb.h index 08265993227f..48066ce9ea34 100644 --- a/arch/arm/include/asm/kgdb.h +++ b/arch/arm/include/asm/kgdb.h @@ -70,7 +70,8 @@ extern int kgdb_fault_expected; #define _GP_REGS 16 #define _FP_REGS 8 #define _EXTRA_REGS 2 -#define DBG_MAX...
931ea24819f2bd40cca2dc214558bfcc3c91549e
Analyze and fix the following issue in the Linux kernel code: kdb: fix per_cpu command to remove supress mask
Problem Details: Rusty pointed out that the per_cpu command uses up lots of space on the stack and the cpu supress mask is probably not needed. This patch removes the need for the supress mask as well as fixing up the following problems with the kdb per_cpu command: * The per_cpu command should allow an address as a...
```diff diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index d7bda21a106b..9755ac05e446 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c @@ -2603,20 +2603,17 @@ static int kdb_summary(int argc, const char **argv) */ static int kdb_per_cpu(int argc, const char **argv)...
a2d49358ba9bc93204dc001d5568c5bdb299b77d
Analyze and fix the following issue in the Linux kernel code: ftrace/MIPS: Add MIPS64 support for C version of recordmcount
Problem Details: MIPS64 has 'weird' Elf64_Rel.r_info[1,2], which must be used instead of the generic Elf64_Rel.r_info, otherwise, the C version of recordmcount will not work for "segmentation fault". Usage of "union mips_r_info" and the functions MIPS64_r_sym() and MIPS64_r_info() written by Maciej W. Rozycki <macro@l...
```diff diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c index 26e1271259ba..2d32b9ced20a 100644 --- a/scripts/recordmcount.c +++ b/scripts/recordmcount.c @@ -217,6 +217,39 @@ is_mcounted_section_name(char const *const txtname) #define RECORD_MCOUNT_64 #include "recordmcount.h" +/* 64-bit EM_MIPS has we...
48e1fd5a81416a037f5a48120bf281102f2584e2
Analyze and fix the following issue in the Linux kernel code: MIPS: Convert DMA to use dma-mapping-common.h
Problem Details: Use asm-generic/dma-mapping-common.h to handle all DMA mapping operations and establish a default get_dma_ops() that forwards all operations to the existing code. Augment dev_archdata to carry a pointer to the struct dma_map_ops, allowing DMA operations to be overridden on a per device basis. Current...
```diff diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 4d4744f07e52..535a08ad69b3 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -14,6 +14,8 @@ config MIPS select HAVE_KRETPROBES select RTC_LIB if !MACH_LOONGSON select GENERIC_ATOMIC64 if !64BIT + select HAVE_DMA_ATTRS + select HAVE_DMA_API_D...
334c86c494b9a5754d4c0ffa3110b18c9771013b
Analyze and fix the following issue in the Linux kernel code: MIPS: IRQ: Add stackoverflow detection
Problem Details: Add stackoverflow detection to mips arch Signed-off-by: Adam Jiang <jiang.adam@gmail.com> Cc: dmitri.vorobiev@movial.com Cc: wuzhangjin@gmail.com Cc: ddaney@caviumnetworks.com Cc: peterz@infradead.org Cc: fweisbec@gmail.com Cc: tj@kernel.org Cc: tglx@linutronix.de Cc: mingo@elte.hu Cc: linux-mips@linu...
```diff diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug index 43dc27997730..f437cd1fafb8 100644 --- a/arch/mips/Kconfig.debug +++ b/arch/mips/Kconfig.debug @@ -67,6 +67,15 @@ config CMDLINE_OVERRIDE Normally, you will choose 'N' here. +config DEBUG_STACKOVERFLOW + bool "Check for stack overflows"...
7837314d141c661c70bc13c5050694413ecfe14a
Analyze and fix the following issue in the Linux kernel code: MIPS: Get rid of branches to .subsections.
Problem Details: It was a nice optimization - on paper at least. In practice it results in branches that may exceed the maximum legal range for a branch. We can fight that problem with -ffunction-sections but -ffunction-sections again is incompatible with -pg used by the function tracer. By rewriting the loop around...
```diff diff --git a/arch/mips/Makefile b/arch/mips/Makefile index f4a4b663ebb3..1a81240102c5 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -48,9 +48,6 @@ ifneq ($(SUBARCH),$(ARCH)) endif endif -ifndef CONFIG_FUNCTION_TRACER -cflags-y := -ffunction-sections -endif ifdef CONFIG_FUNCTION_GRAPH_TRACER...
d817d29d0b37290d90b3a9e2a61162f1dbf2be4f
Analyze and fix the following issue in the Linux kernel code: netfilter: fix nf_conntrack_l4proto_register()
Problem Details: While doing __rcu annotations work on net/netfilter I found following bug. On some arches, it is possible we publish a table while its content is not yet committed to memory, and lockless reader can dereference wild pointer. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Patrick M...
```diff diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c index ed6d92958023..dc7bb74110df 100644 --- a/net/netfilter/nf_conntrack_proto.c +++ b/net/netfilter/nf_conntrack_proto.c @@ -292,6 +292,12 @@ int nf_conntrack_l4proto_register(struct nf_conntrack_l4proto *l4proto) for (i ...
435f49a518c78eec8e2edbbadd912737246cbe20
Analyze and fix the following issue in the Linux kernel code: readv/writev: do the same MAX_RW_COUNT truncation that read/write does
Problem Details: We used to protect against overflow, but rather than return an error, do what read/write does, namely to limit the total size to MAX_RW_COUNT. This is not only more consistent, but it also means that any broken low-level read/write routine that still keeps counts in 'int' can't break. Signed-off-by: L...
```diff diff --git a/fs/compat.c b/fs/compat.c index 52cfeb61da77..ff66c0d7583d 100644 --- a/fs/compat.c +++ b/fs/compat.c @@ -606,14 +606,14 @@ ssize_t compat_rw_copy_check_uvector(int type, /* * Single unix specification: * We should -EINVAL if an element length is not >= 0 and fitting an - * ssize_t. The t...
6a915c2bf073743dd31229f1ec2eaa7a2b13c1c3
Analyze and fix the following issue in the Linux kernel code: parisc-agp: fix missing slab.h include
Problem Details: Commit 338e4fab added a missing kfree if the alloc_pci_dev failed but forgot to include <linux/slab.h> for the definition of kfree. Signed-off-by: Kyle McMartin <kyle@redhat.com>
```diff diff --git a/drivers/char/agp/parisc-agp.c b/drivers/char/agp/parisc-agp.c index 17e380f5f818..94821ab01c6d 100644 --- a/drivers/char/agp/parisc-agp.c +++ b/drivers/char/agp/parisc-agp.c @@ -19,6 +19,7 @@ #include <linux/klist.h> #include <linux/agp_backend.h> #include <linux/log2.h> +#include <linux/slab.h>...
592488a32b87daf27b92d2c1c5cdc440d1a1beae
Analyze and fix the following issue in the Linux kernel code: [SCSI] pmcraid: add support for set timestamp command and other fixes
Problem Details: The following are the fixes in this patch: 1. Added support of set timestamp command in the driver 2. Pass all status code to mgmt application. Earlier we were passing only failed ones. 3. Call class_destroy after unregister_chrdev and pci_unregister_driver Signed-off-by: Anil Ravindranath <anil_r...
```diff diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index 4b8765785aeb..cf89091e4c3d 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -1594,10 +1594,12 @@ static void pmcraid_handle_config_change(struct pmcraid_instance *pinstance) cfg_entry = &ccn_hcam->cfg_entry; fw_version = b...
f0daed0242d514033b9ecca9187108d3c4e281a5
Analyze and fix the following issue in the Linux kernel code: jump_label: Fix unaligned traps on sparc.
Problem Details: The vmlinux.lds.h knobs to emit the __jump_table section in the main kernel image takes care to align the section, but this doesn't help for the __jump_table section that gets emitted into modules. Fix the resulting lack of section alignment by explicitly specifying it in the assembler. Signed-off-by...
```diff diff --git a/arch/sparc/include/asm/jump_label.h b/arch/sparc/include/asm/jump_label.h index 62e66d7b2fb6..d95cf44fb40d 100644 --- a/arch/sparc/include/asm/jump_label.h +++ b/arch/sparc/include/asm/jump_label.h @@ -14,6 +14,7 @@ "nop\n\t" \ "nop\n\t" \ ".pushsection __jump_table, \"a\"\n\t...
de31c3ca8179d7c21def7ecb56e4fec0c8659d36
Analyze and fix the following issue in the Linux kernel code: jump label: Fix error with preempt disable holding mutex
Problem Details: Kprobes and jump label were having a race between mutexes that was fixed by reordering the jump label. But this reordering moved the jump label mutex into a preempt disable location. This patch does a little fiddling to move the grabbing of the jump label mutex from inside the preempt disable section ...
```diff diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 9437e14f36bd..9737a76e106f 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -1145,17 +1145,13 @@ int __kprobes register_kprobe(struct kprobe *p) if (ret) return ret; - preempt_disable(); jump_label_lock(); + preempt_disable(); if (!kernel_...
2e21b3f124eceb6ab5a07c8a061adce14ac94e14
Analyze and fix the following issue in the Linux kernel code: eCryptfs: Clear LOOKUP_OPEN flag when creating lower file
Problem Details: eCryptfs was passing the LOOKUP_OPEN flag through to the lower file system, even though ecryptfs_create() doesn't support the flag. A valid filp for the lower filesystem could be returned in the nameidata if the lower file system's create() function supported LOOKUP_OPEN, possibly resulting in unencryp...
```diff diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 63e6ec0e8b50..9d1a22d62765 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c @@ -71,15 +71,19 @@ ecryptfs_create_underlying_file(struct inode *lower_dir_inode, struct vfsmount *lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry); struct dent...
18e503d695ff8ff9a43768555aa74575bf6b77f3
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix raid code for removing missing drives
Problem Details: When btrfs is mounted in degraded mode, it has some internal structures to track the missing devices. This missing device is setup as readonly, but the mapping code can get upset when we try to write to it. This changes the mapping code to return -EIO instead of oops when we try to write to the reado...
```diff diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index dd318ff280b2..28681e729b1d 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -3034,8 +3034,7 @@ int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio, } bio->bi_sector = multi->stripes[dev_nr].physical >> 9; dev = multi->...
9ec2708053b647969bee862902872d44a5f9b439
Analyze and fix the following issue in the Linux kernel code: [S390] fix kprobes single stepping
Problem Details: Fix kprobes after git commit 1e54622e0403891b10f2105663e0f9dd595a1f17 broke it. The kprobe_handler is now called with interrupts in the state at the time of the breakpoint. The single step of the replaced instruction is done with interrupts off which makes it necessary to enable and disable the interup...
```diff diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S index 5efce7202984..1ecc337fb679 100644 --- a/arch/s390/kernel/entry.S +++ b/arch/s390/kernel/entry.S @@ -557,6 +557,7 @@ pgm_svcper: # per was called from kernel, must be kprobes # kernel_per: + REENABLE_IRQS mvi SP_SVCNR(%r15),0xff # set tr...
f2166bb117952404689f0dc42624ee0b54a66e5e
Analyze and fix the following issue in the Linux kernel code: [S390] tape: fix dbf usage
Problem Details: Get rid of the format string "%s" usage with volatile strings to prevent use after free errors in the s390dbf. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
```diff diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c index 29c2d73d719d..6c408670e08d 100644 --- a/drivers/s390/char/tape_core.c +++ b/drivers/s390/char/tape_core.c @@ -1077,15 +1077,14 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb) /* FIXME: What to ...
3c8ebca0453c71a2a8be79e6dd40e7be2d6167cb
Analyze and fix the following issue in the Linux kernel code: [S390] hypfs: Fix error handling in hypfs_diag initialization
Problem Details: Fix the following two error handling bugs in hypfs_diag_init(): * No need for calling diag204_free_buffer() * Initialize name table only in case of LPAR and prevent error message on non-LPAR systems. Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwi...
```diff diff --git a/arch/s390/hypfs/hypfs_diag.c b/arch/s390/hypfs/hypfs_diag.c index 020e51c063d2..cd4a81be9cf8 100644 --- a/arch/s390/hypfs/hypfs_diag.c +++ b/arch/s390/hypfs/hypfs_diag.c @@ -638,18 +638,21 @@ __init int hypfs_diag_init(void) pr_err("The hardware system does not support hypfs\n"); return -ENOD...
0b52783d4feb14d6ff990a63512a66d6131d41f9
Analyze and fix the following issue in the Linux kernel code: [S390] topology: fix cpu masks for topology=off case
Problem Details: Fix cpu masks for 'topology=off' case. Folding of the scheduling domains happen in such a way that everything belongs to the MC domain instead of the CPU doimain. This should fix a performance regression introduced with eafd2b6d "[S390] topology: use default MC domain initializer" and also makes sure w...
```diff diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index a9dee9048ee5..94b06c31fc8a 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c @@ -53,8 +53,10 @@ static cpumask_t cpu_group_map(struct mask_info *info, unsigned int cpu) cpumask_t mask; cpus_clear(mask); -...
64e46749224aa658d8fc0d37ea83ab20b1d7955d
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_nat: fix compiler warning with CONFIG_NF_CT_NETLINK=n
Problem Details: net/ipv4/netfilter/nf_nat_core.c:52: warning: 'nf_nat_proto_find_get' defined but not used net/ipv4/netfilter/nf_nat_core.c:66: warning: 'nf_nat_proto_put' defined but not used Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Patrick McHardy <kaber@trash.net>
```diff diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c index 295c97431e43..c04787ce1a71 100644 --- a/net/ipv4/netfilter/nf_nat_core.c +++ b/net/ipv4/netfilter/nf_nat_core.c @@ -47,26 +47,6 @@ __nf_nat_proto_find(u_int8_t protonum) return rcu_dereference(nf_nat_protos[protonum]); } ...
78ca7c37efaa541006269aa3d3e560ea7926e245
Analyze and fix the following issue in the Linux kernel code: PM / Runtime: Fix typo in status comparison causing warning
Problem Details: GCC version 4.5.1 gives the following warning: drivers/base/power/runtime.c: In function ‘rpm_check_suspend_allowed’: drivers/base/power/runtime.c:146:25: warning: comparison between ‘enum dpm_state’ and ‘enum rpm_status’ which seems to be a typo in that dev->power.runtime_status should be compared i...
```diff diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 126ca492dd08..02c652be83e7 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -143,7 +143,7 @@ static int rpm_check_suspend_allowed(struct device *dev) /* Pending resume requests take precedence over ...
4ac3dbec800d93485a5c84e37af676278eea657c
Analyze and fix the following issue in the Linux kernel code: oprofile: Fix the hang while taking the cpu offline
Problem Details: The kernel build with CONFIG_OPROFILE and CPU_HOTPLUG enabled. The oprofile is initialised using system timer in absence of hardware counters supports. Oprofile isn't started from userland. In this setup while doing a CPU offline the kernel hangs in infinite for loop inside lock_hrtimer_base() functio...
```diff diff --git a/drivers/oprofile/timer_int.c b/drivers/oprofile/timer_int.c index dc0ae4d14dff..010725117dbb 100644 --- a/drivers/oprofile/timer_int.c +++ b/drivers/oprofile/timer_int.c @@ -21,6 +21,7 @@ #include "oprof.h" static DEFINE_PER_CPU(struct hrtimer, oprofile_hrtimer); +static int ctr_running; sta...
b0438a1b71955c425c304a2a483765ef24841766
Analyze and fix the following issue in the Linux kernel code: telephony: fix return value
Problem Details: If copy_from_user fails, the return value gets overwritten. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
```diff diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c index 0d236f4bb8c2..2d1280a7a52b 100644 --- a/drivers/telephony/ixj.c +++ b/drivers/telephony/ixj.c @@ -6581,7 +6581,8 @@ static long do_ixj_ioctl(struct file *file_p, unsigned int cmd, unsigned long ar case IXJCTL_SET_FILTER: if (copy_from_use...
e5a0726a953daf224ae42bcf5edaa64f71b4e8a7
Analyze and fix the following issue in the Linux kernel code: logfs: fix a leak in get_sb
Problem Details: a) switch ->put_device() to logfs_super * b) actually call it on early failures in logfs_get_sb_device() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
```diff diff --git a/fs/logfs/dev_bdev.c b/fs/logfs/dev_bdev.c index 223b673dcc7b..92ca6fbe09bd 100644 --- a/fs/logfs/dev_bdev.c +++ b/fs/logfs/dev_bdev.c @@ -298,9 +298,9 @@ static int bdev_write_sb(struct super_block *sb, struct page *page) return sync_request(page, bdev, WRITE); } -static void bdev_put_device(s...
d893f1bc2a9f0f7dcb4b433452c59f9bedac0d7d
Analyze and fix the following issue in the Linux kernel code: fix open/umount race
Problem Details: nameidata_to_filp() drops nd->path or transfers it to opened file. In the former case it's a Bad Idea(tm) to do mnt_drop_write() on nd->path.mnt, since we might race with umount and vfsmount in question might be gone already. Fix: don't drop it, then... IOW, have nameidata_to_filp() grab nd->path in...
```diff diff --git a/fs/namei.c b/fs/namei.c index f7dbc06857ab..5362af9b7372 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1574,6 +1574,7 @@ static struct file *finish_open(struct nameidata *nd, */ if (will_truncate) mnt_drop_write(nd->path.mnt); + path_put(&nd->path); return filp; exit: @@ -1675,6 +1676,7...
5c1eb08936693cd78c71164c8bea0b086ae72c67
Analyze and fix the following issue in the Linux kernel code: x86-32: Restore irq stacks NUMA-aware allocations
Problem Details: Commit 22d4cd4c4d ("Allocate irq stacks seperate from percpu area") removed NUMA affinity of IRQ stacks as side-effect of the fix. Using alloc_pages_node() instead of __get_free_pages() is safe, even if the target node has no available LOWMEM pages : alloc_pages_node() fallbacks to another node. Sign...
```diff diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c index 64668dbf00a4..96656f207751 100644 --- a/arch/x86/kernel/irq_32.c +++ b/arch/x86/kernel/irq_32.c @@ -17,6 +17,7 @@ #include <linux/delay.h> #include <linux/uaccess.h> #include <linux/percpu.h> +#include <linux/mm.h> #include <asm/apic.h...
046abeede717909feec38587d667cde1fc6c459c
Analyze and fix the following issue in the Linux kernel code: md/raid1: fix some typos in comments.
Problem Details: Signed-off-by: NeilBrown <neilb@suse.de>
```diff diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index f7a8954d665f..a0322db4d355 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -666,7 +666,7 @@ static void raise_barrier(conf_t *conf) /* block any new IO from starting */ conf->barrier++; - /* No wait for all pending IO to complete */ + ...
bac64d0f8cfd45f1027b6e946785a56e8d694fba
Analyze and fix the following issue in the Linux kernel code: Input: bu21013_ts - fix null dereference in error handling
Problem Details: bu21013_data could be NULL so better not reference it. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
```diff diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c index ccde58602563..2ca9e5d66460 100644 --- a/drivers/input/touchscreen/bu21013_ts.c +++ b/drivers/input/touchscreen/bu21013_ts.c @@ -514,7 +514,7 @@ err_free_irq: err_cs_disable: pdata->cs_dis(pdata->cs_pin); err_f...
20d190473328b90755eb2434cf2d26b73a53ef23
Analyze and fix the following issue in the Linux kernel code: kconfig: Fix streamline_config to read multi line deps in Kconfig files
Problem Details: I noticed that some Kconfig files have multi line dependencies that continue with a backslash. Those dependencies on the next line will be missed by streamline_config. For example: config CS89x0 tristate "CS89x0 support" depends on NET_ETHERNET && (ISA || EISA || MACH_IXDP2351 \ || ARCH_IXDP2X01 ...
```diff diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index 883748c70d28..ebba407ac5eb 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -125,7 +125,6 @@ my %selects; my %prompts; my %objects; my $var; -my $cont = 0; my $ifleve...
cf5a189d4a02efb3712cfb424452f4ce3ab7c4a2
Analyze and fix the following issue in the Linux kernel code: kconfig: Fix missing declaration of variable $dir in streamline_config.pl
Problem Details: On Fri, Aug 17, 2010 at 01:43PM +0800, Américo Wang wrote: > Acked-by: WANG Cong <xiyou.wangcong@gmail.com> > > BTW, I think we should add "use strict;" too. Then I added "use strict;" to streamline_config.pl, I saw another warning. > Global symbol "$dir" requires explicit package name at scripts/kco...
```diff diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index 3c63aa943ee3..883748c70d28 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -42,6 +42,8 @@ # mv config_strip .config # make oldconfig # +use strict; + my $confi...
ccece60ac69608c496b07c0d31a68894db0a22b3
Analyze and fix the following issue in the Linux kernel code: kconfig: Fix variable name typo %prompts in streamline_config.pl
Problem Details: When I added "use strict;" to streamline_config.pl, I saw the following warnings: > Global symbol "%prompt" requires explicit package name at scripts/kconfig/streamline_config.pl line 183. > Global symbol "%prompt" requires explicit package name at scripts/kconfig/streamline_config.pl line 368. The d...
```diff diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index cc10bcfda64f..3c63aa943ee3 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -188,7 +188,7 @@ sub read_kconfig { # configs without prompts must be selected } elsif ($s...
419db274bed4269f475a8e78cbe9c917192cfe8b
Analyze and fix the following issue in the Linux kernel code: x86, memblock: Fix early_node_mem with big reserved region.
Problem Details: Xen can reserve huge amounts of memory for pre-ballooning, but that still shows as RAM in the e820 memory map. early_node_mem could not find range because of start/end adjusting, and will go through the fallback path. However, the fallback patch is still using memblock_x86_find_range_node(), and it i...
```diff diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index 60f498511dd6..7ffc9b727efd 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c @@ -178,11 +178,8 @@ static void * __init early_node_mem(int nodeid, unsigned long start, /* extend the search scope */ end = max_pfn_mapped << PAGE_SH...
cef92fe63836dcc63db6ccfbea0a6d9255f491a9
Analyze and fix the following issue in the Linux kernel code: mfd: Fix a memory leak when unload mc13xxx-core module
Problem Details: Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
```diff diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c index 1326e7f4263a..a2ac2ed6d64c 100644 --- a/drivers/mfd/mc13xxx-core.c +++ b/drivers/mfd/mc13xxx-core.c @@ -795,6 +795,8 @@ static int __devexit mc13xxx_remove(struct spi_device *spi) mfd_remove_devices(&spi->dev); + kfree(mc13xxx); + ...
7484552eb24e3c62ef55a4ff0133d8450adea206
Analyze and fix the following issue in the Linux kernel code: mfd: Fix resource reclaim for max8998
Problem Details: Properly free irq and unregister max8998->rtc device in max8998_i2c_probe() error path and max8998_i2c_remove(). Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
```diff diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c index 06ddf741d4c7..bb9977bebe78 100644 --- a/drivers/mfd/max8998.c +++ b/drivers/mfd/max8998.c @@ -153,6 +153,8 @@ static int max8998_i2c_probe(struct i2c_client *i2c, err: mfd_remove_devices(max8998->dev); + max8998_irq_exit(max8998); + i2c_unreg...
8220fe4cb25d0177bd0795a516d2023799008ca0
Analyze and fix the following issue in the Linux kernel code: mfd: Fix resource reclaim in pcf50633_remove()
Problem Details: Calling sysfs_remove_group() to remove sysfs entries and unregister bl_pdev in pcf50633_remove(). Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Harald Welte <laforge@gnumonks.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
```diff diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c index 6d4233f0d0d3..501ce13b693e 100644 --- a/drivers/mfd/pcf50633-core.c +++ b/drivers/mfd/pcf50633-core.c @@ -339,12 +339,14 @@ static int __devexit pcf50633_remove(struct i2c_client *client) struct pcf50633 *pcf = i2c_get_clientdata(cli...
bf56f0a6668cd399b5136d2216f24ec97f0ce716
Analyze and fix the following issue in the Linux kernel code: omap4: pandaboard: fix up mmc card detect logic
Problem Details: For MMC1 Controller, card detect interrupt source is twl6030 which is non-gpio. The card detect call back function provides card present/absent status by reading MMC Control register present on twl6030. This functionality was introduced in mfd tree on track to kernel.org Sync pandaboard to the same an...
```diff diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 702f2a63f2c1..1ecd0a6cefb7 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -160,10 +160,19 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev) s...
47dabaeedb4d6e841ac4d66ef249ce9c61303049
Analyze and fix the following issue in the Linux kernel code: mfd: Fix ezx_pcap_probe error path
Problem Details: return -ENOMEM if create_singlethread_workqueue failed. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
```diff diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c index d283d77937b9..c2b698d69a93 100644 --- a/drivers/mfd/ezx-pcap.c +++ b/drivers/mfd/ezx-pcap.c @@ -465,6 +465,7 @@ static int __devinit ezx_pcap_probe(struct spi_device *spi) pcap->irq_base = pdata->irq_base; pcap->workqueue = create_singlethre...
a8d6aa08dd3e004df6a6e63a61698d834a191ad3
Analyze and fix the following issue in the Linux kernel code: mfd: Fix off-by-one value range checking for tps6507x
Problem Details: If bytes == (TPS6507X_MAX_REGISTER + 1), we have a buffer overflow when doing memcpy(&msg[1], src, bytes). Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
```diff diff --git a/drivers/mfd/tps6507x.c b/drivers/mfd/tps6507x.c index fc0197649281..33ba7723c967 100644 --- a/drivers/mfd/tps6507x.c +++ b/drivers/mfd/tps6507x.c @@ -68,7 +68,7 @@ static int tps6507x_i2c_write_device(struct tps6507x_dev *tps6507x, char reg, u8 msg[TPS6507X_MAX_REGISTER + 1]; int ret; - if (b...
00969f23dae70f62d7ce3f7abbbfb6d09ef92739
Analyze and fix the following issue in the Linux kernel code: mfd: Remove DEBUG defines from mc13xxx-core
Problem Details: DEBUG and VERBOSE_DEBUG are not used. Reported-by: David Jander <david@protonic.nl> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
```diff diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c index 93258adf8b63..1326e7f4263a 100644 --- a/drivers/mfd/mc13xxx-core.c +++ b/drivers/mfd/mc13xxx-core.c @@ -9,8 +9,6 @@ * the terms of the GNU General Public License version 2 as published by the * Free Software Foundation. */ -#define...
f9c28019d44a97272ef0f382e8d0d1a85dd1cf3e
Analyze and fix the following issue in the Linux kernel code: mfd: Fix jz4740_adc_set_enabled
Problem Details: When enabled is false, clear BIT(engine) of JZ_REG_ADC_ENABLE register. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
```diff diff --git a/drivers/mfd/jz4740-adc.c b/drivers/mfd/jz4740-adc.c index 3ad492cb6c41..9dd1b33f2275 100644 --- a/drivers/mfd/jz4740-adc.c +++ b/drivers/mfd/jz4740-adc.c @@ -153,7 +153,7 @@ static inline void jz4740_adc_set_enabled(struct jz4740_adc *adc, int engine, if (enabled) val |= BIT(engine); else - ...
b0b4a7c28ebee0763cae90d470cfff501a83be37
Analyze and fix the following issue in the Linux kernel code: mfd: Fix twl-irq function declaration warnings
Problem Details: Fixes following sparse warnings for twl4030 and twl6030 irq files. drivers/mfd/twl4030-irq.c:783:5: warning: symbol 'twl4030_init_irq' was not declared. Should it be static? drivers/mfd/twl4030-irq.c:863:5: warning: symbol 'twl4030_exit_irq' was not declared. Should it be static? drivers/mfd/twl4030-i...
```diff diff --git a/drivers/mfd/twl-core.h b/drivers/mfd/twl-core.h new file mode 100644 index 000000000000..8c50a556e986 --- /dev/null +++ b/drivers/mfd/twl-core.h @@ -0,0 +1,10 @@ +#ifndef __TWL_CORE_H__ +#define __TWL_CORE_H__ + +extern int twl6030_init_irq(int irq_num, unsigned irq_base, unsigned irq_end); +extern...
8e52e279b241d3a22d52c10a5f934db18b7d0a1b
Analyze and fix the following issue in the Linux kernel code: mfd: Fix TWL4030 COR bit polarity for BCI SIH block
Problem Details: The chip TRM documentation contradicts itself about this bit, page 174 of swcu050e says bit should be 0 for clear-on-read behavior, while page 487 says it should be 1. Testing shows it should be 1, so set the .set_cor flag accordingly. This is needed for upcoming BCI charging driver to function. Signe...
```diff diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c index b9fda7018cef..381ab26e92a3 100644 --- a/drivers/mfd/twl4030-irq.c +++ b/drivers/mfd/twl4030-irq.c @@ -144,6 +144,7 @@ static const struct sih sih_modules_twl4030[6] = { .name = "bci", .module = TWL4030_MODULE_INTERRUPTS, .contro...
2cfcce18bb09667f583f4a29e814cbadf1d4e525
Analyze and fix the following issue in the Linux kernel code: mfd: Fix twl-core sparse warning
Problem Details: Fixes below sparse warning. drivers/mfd/twl-core.c:258:20: warning: symbol 'twl_map' was not declared. Should it be static? Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com> Cc: linux-arm-kernel@lists.infradead.org Cc: Tony Lindgren <tony@atomide.com> Cc: Nishanth Menon <nm@ti.com> Signed-off-by:...
```diff diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index b0f2c0004efe..e77e1ffd26a9 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -249,7 +249,7 @@ struct twl_mapping { unsigned char sid; /* Slave ID */ unsigned char base; /* base address */ }; -struct twl_mapping *twl_map; +...
02bf07492341d94e29890082201dd69dbf406570
Analyze and fix the following issue in the Linux kernel code: gpio: Fix stmpe error path
Problem Details: Free allocated memory. Call stmpe_disable() if it was enabled. Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
```diff diff --git a/drivers/gpio/stmpe-gpio.c b/drivers/gpio/stmpe-gpio.c index 932759db1ac2..7c9e6a052c45 100644 --- a/drivers/gpio/stmpe-gpio.c +++ b/drivers/gpio/stmpe-gpio.c @@ -315,11 +315,11 @@ static int __devinit stmpe_gpio_probe(struct platform_device *pdev) ret = stmpe_enable(stmpe, STMPE_BLOCK_GPIO); ...
d5a0514e5fdba59e759d42be2f752366d5b6c03f
Analyze and fix the following issue in the Linux kernel code: mfd: Update kconfig for ab8500 core driver
Problem Details: This patch add a dependancy for ab8500-core driver so as to depend on u8500 platform. This patch also fixes the build issues(powerpc_allyesconfig) for the patch 03f582a93ecca6e9584b622570022abf08ed03ec (misc: Add ab8500 pwm driver) Signed-off-by: Arun Murthy <arun.murthy@stericsson.com> Acked-by: Lin...
```diff diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 66779bdc9627..d365e9dd190b 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -475,7 +475,7 @@ config EZX_PCAP config AB8500_CORE bool "ST-Ericsson AB8500 Mixed Signal Power Management chip" - depends on GENERIC_HARDIRQS && ABX500_CORE...
68accd7370a90b899ea6563ba9032e5a102ec1b5
Analyze and fix the following issue in the Linux kernel code: ARM: mach-shmobile: ap4evb: Fix hotplug for SDHI1
Problem Details: On AP4EVB the card detect pin of the top SD/MMC slot is not directly connected to the tmio/mmcif controller but to a GPIO pin, so polling needs to be done for SDHI1 and MMCIF in order to support hotplug for that slot. SHDI1 and MMCIF share that slot, and the used controller is selected by a DIP switch....
```diff diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index 14923989ea05..22a2b44ddb7b 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c @@ -235,6 +235,18 @@ static struct platform_device smc911x_device = { }, }; +/* + * The ...
929980ab1b90b5a5c93db9b9b7d58cc6e93049c8
Analyze and fix the following issue in the Linux kernel code: mfd: Fix tps6586x_add_subdevs error path
Problem Details: 1. return -ENOMEM if platform_device_alloc() fail. 2. call platform_device_put() if platform_device_add() fail. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
```diff diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c index bc6587194de9..2f9336c3710c 100644 --- a/drivers/mfd/tps6586x.c +++ b/drivers/mfd/tps6586x.c @@ -273,13 +273,19 @@ static int __devinit tps6586x_add_subdevs(struct tps6586x *tps6586x, subdev = &pdata->subdevs[i]; pdev = platform_device_al...
09ff21e0f670a71ea43765cedaab9246fd81540e
Analyze and fix the following issue in the Linux kernel code: mfd: Fix pcap_add_subdev error path
Problem Details: 1. return -ENOMEM if platform_device_alloc() fail. 2. call platform_device_put() if platform_device_add() fail. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
```diff diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c index 134c69aa4790..d283d77937b9 100644 --- a/drivers/mfd/ezx-pcap.c +++ b/drivers/mfd/ezx-pcap.c @@ -384,12 +384,20 @@ static int __devinit pcap_add_subdev(struct pcap_chip *pcap, struct pcap_subdev *subdev) { struct platform_device *pdev; ...
b59cedeffaef54dd091baf01fd5e276ac50a3176
Analyze and fix the following issue in the Linux kernel code: mfd: Fix da903x_add_subdevs error path
Problem Details: This patch fixes da903x_add_subdevs error path: 1. return -ENOMEM if platform_device_alloc() fail. 2. call platform_device_put() if platform_device_add() fail. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Eric Miao <eric.y.miao@gmail.com> Acked-by: Mike Rapoport <mike@compulab.co.il> Signed-...
```diff diff --git a/drivers/mfd/da903x.c b/drivers/mfd/da903x.c index c07aece900fb..2fadbaeb1cb1 100644 --- a/drivers/mfd/da903x.c +++ b/drivers/mfd/da903x.c @@ -470,13 +470,19 @@ static int __devinit da903x_add_subdevs(struct da903x_chip *chip, subdev = &pdata->subdevs[i]; pdev = platform_device_alloc(subdev-...
29c3e8c8d16b74e91da9be445ff3e14136957753
Analyze and fix the following issue in the Linux kernel code: watchdog: MachZ: fix debug macro
Problem Details: Fix debug macro line wrapping. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
```diff diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c index edffe68e3d2f..928035069396 100644 --- a/drivers/watchdog/machzwd.c +++ b/drivers/watchdog/machzwd.c @@ -143,7 +143,7 @@ static unsigned long next_heartbeat; #ifndef ZF_DEBUG # define dprintk(format, args...) #else -# define dprintk(fo...
ec10b0e94ebe7de3b301d60e6f7f4a12d3d280c6
Analyze and fix the following issue in the Linux kernel code: regulator: max8952 - fix max8952_set_voltage
Problem Details: In current implementation, vid is declared as u8, then "vid == -1" is always false, and "vid >= 0" is always true. Thus change it to s8. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-of...
```diff diff --git a/drivers/regulator/max8952.c b/drivers/regulator/max8952.c index 7d6aacf5c493..0d5dda4fd911 100644 --- a/drivers/regulator/max8952.c +++ b/drivers/regulator/max8952.c @@ -136,7 +136,7 @@ static int max8952_set_voltage(struct regulator_dev *rdev, int min_uV, int max_uV) { struct max8952_data ...
da05738e94b644d759f28184a9f0bf875b271c55
Analyze and fix the following issue in the Linux kernel code: regulator: max8952 - fix max8952_pmic_probe error path
Problem Details: Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
```diff diff --git a/drivers/regulator/max8952.c b/drivers/regulator/max8952.c index f2af0b1c3925..7d6aacf5c493 100644 --- a/drivers/regulator/max8952.c +++ b/drivers/regulator/max8952.c @@ -212,9 +212,11 @@ static int __devinit max8952_pmic_probe(struct i2c_client *client, max8952->rdev = regulator_register(&regulat...
f5ee10ab42c76f36eea1bd6f7a35da387635ebf9
Analyze and fix the following issue in the Linux kernel code: regulator: fix build when CONFIG_REGULATOR_DUMMY=n
Problem Details: Commit f03f91826 (regulator: Add option for machine drivers to enable the dummy regulator) in the regulators tree seems to have introduced the following build break when CONFIG_REGULATOR_DUMMY is disabled. Fix this. CC drivers/regulator/dummy.o drivers/regulator/dummy.c:41: error: redefinition ...
```diff diff --git a/drivers/regulator/dummy.h b/drivers/regulator/dummy.h index 3921c0e24249..97a11b7e8882 100644 --- a/drivers/regulator/dummy.h +++ b/drivers/regulator/dummy.h @@ -22,10 +22,6 @@ struct regulator_dev; extern struct regulator_dev *dummy_regulator_rdev; -#ifdef CONFIG_REGULATOR_DUMMY void __init ...
8cbf811dfd027bde8504e541d0009c5722b98be5
Analyze and fix the following issue in the Linux kernel code: regulator: avoid deadlock when disabling regulator with supply
Problem Details: I have a regulator A that sets regulator B as its supply. When I call set_supply to add B as the supply for A, regulator A gets added to the supply_list for regulator B. When I call regulator_disable(A), I end up with a call chain like this: regulator_disable(A) > mutex_lock(A) > _regulator_disable(A...
```diff diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 4fa08c85f3ce..f1d10c974cd4 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -64,7 +64,8 @@ struct regulator { }; static int _regulator_is_enabled(struct regulator_dev *rdev); -static int _regulator_disable(struct r...
993af7c048f414121bc81e0d6e69456e3862a06b
Analyze and fix the following issue in the Linux kernel code: Regulator: lp3972 cleanup
Problem Details: This patch includes below fixes based on Mark's comment. - Return actual error if i2c_smbus_read_byte_data() fail - Add spaces around bitwise AND operator(&) to improve readability - Add comment to explain why we need to update voltage change control register for LDO1 and LDO5 - Logging the valu...
```diff diff --git a/drivers/regulator/lp3972.c b/drivers/regulator/lp3972.c index 0d9b47569c1b..e07062fd0b42 100644 --- a/drivers/regulator/lp3972.c +++ b/drivers/regulator/lp3972.c @@ -192,7 +192,7 @@ static int lp3972_i2c_read(struct i2c_client *i2c, char reg, int count, return -EIO; ret = i2c_smbus_read_byte_d...
202f4f53e503ae09b431459131b5b3a99fa6d839
Analyze and fix the following issue in the Linux kernel code: MAX8952 PMIC Driver Initial Release
Problem Details: MAX8952 PMIC is used to provide voltage output between 770mV - 1400mV with DVS support. In this initial release, users can set voltages for four DVS modes, RAMP delay values, and SYNC frequency. Controlling FPWM/SYNC_MODE/Pull-Down/Ramp Modes and reading CHIP_ID is not supported in this release. If GP...
```diff diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 172951bf23a4..4889caabc632 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -100,6 +100,14 @@ config REGULATOR_MAX8925 help Say y here to support the voltage regulaltor of Maxim MAX8925 PMIC. +config REGULA...
b1142e8fec6a594723e5054055a7b53379b90490
Analyze and fix the following issue in the Linux kernel code: ext4: BUG_ON fix: check if page has buffers before calling page_buffers()
Problem Details: We need to make check if a page does not have buffes by checking page_has_buffers(page) before calling page_buffers(page) in ext4_writepage(). Otherwise page_buffers() could throw a BUG_ON. Thanks also to Markus Trippelsdorf and Avinash Kurup who also reported the problem. Signed-off-by: "Theodore T...
```diff diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 2d6c6c8c036d..191616470466 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2718,7 +2718,7 @@ static int ext4_writepage(struct page *page, * try to create them using __block_write_begin. If this * fails, redirty the page and move on. */ - if (...
19ba54f4645f8c5edae4b08919a37a409b8793aa
Analyze and fix the following issue in the Linux kernel code: fs/notify/fanotify/fanotify_user.c: fix warnings
Problem Details: fs/notify/fanotify/fanotify_user.c: In function 'fanotify_release': fs/notify/fanotify/fanotify_user.c:375: warning: unused variable 'lre' fs/notify/fanotify/fanotify_user.c:375: warning: unused variable 're' this is really ugly. Cc: Eric Paris <eparis@redhat.com> Signed-off-by: Andrew Morton <akpm@l...
```diff diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index fa71d5dfd102..fce66dfbf7d5 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c @@ -376,11 +376,10 @@ static ssize_t fanotify_write(struct file *file, const char __user *buf, size_t st...
50e4a98914de13c6f38f50fd1afa06e2c18b3cf7
Analyze and fix the following issue in the Linux kernel code: fanotify: Fix FAN_CLOSE comments
Problem Details: The comments for FAN_CLOSE_WRITE and FAN_CLOSE_NOWRITE do not match FS_CLOSE_WRITE and FS_CLOSE_NOWRITE, respectively. WRITE is for writable files while NOWRITE is for non-writable files. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Eric Paris <eparis@redhat.com>
```diff diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h index 5e0400a80c33..0f0121467fc4 100644 --- a/include/linux/fanotify.h +++ b/include/linux/fanotify.h @@ -6,8 +6,8 @@ /* the following events that user-space can register for */ #define FAN_ACCESS 0x00000001 /* File was accessed */ #define FAN...
52420392c81c8712f555e6bcd116d8bd214ce43a
Analyze and fix the following issue in the Linux kernel code: fsnotify: call fsnotify_parent in perm events
Problem Details: fsnotify perm events do not call fsnotify parent. That means you cannot register a perm event on a directory and enforce permissions on all inodes in that directory. This patch fixes that situation. Signed-off-by: Eric Paris <eparis@redhat.com>
```diff diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c index 57ecadd85abf..20dc218707ca 100644 --- a/fs/notify/fsnotify.c +++ b/fs/notify/fsnotify.c @@ -84,16 +84,17 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode) } /* Notify this dentry's parent about a child's events. */ -void __fsnoti...
d63f6d1b4d3ad0d88685a5f8eb1c3cac01ddd0db
Analyze and fix the following issue in the Linux kernel code: initramfs: Fix build break on symbol-prefixed archs
Problem Details: Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
```diff diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 54fd1b700131..e93525c5e915 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -128,7 +128,9 @@ _c_flags += $(if $(patsubst n%,, \ endif ifdef CONFIG_SYMBOL_PREFIX -_cpp_flags += -DSYMBOL_PREFIX=$(patsubst "%",%,$(CONFIG_SYMBOL_PREFI...
683b65f89a7c26d9a9180d25066815ef5a31bd71
Analyze and fix the following issue in the Linux kernel code: netxen: fix kdump
Problem Details: Reset the whole hw instead of freeing hw resources consumed by each pci function. Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c index 12612127a087..f7d06cbc70ae 100644 --- a/drivers/net/netxen/netxen_nic_ctx.c +++ b/drivers/net/netxen/netxen_nic_ctx.c @@ -254,19 +254,6 @@ out_free_rq: return err; } -static void -nx_fw_cmd_reset_ctx(struct netxen_...
448d7b5daf043d109df98e3e8f8deb165c2e8896
Analyze and fix the following issue in the Linux kernel code: pktgen: Limit how much data we copy onto the stack.
Problem Details: A program that accidentally writes too much data to the pktgen file can overflow the kernel stack and oops the machine. This is only triggerable by root, so there's no security issue, but it's still an unfortunate bug. printk() won't print more than 1024 bytes in a single call, anyways, so let's just ...
```diff diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 679b797d06b1..fbce4b05a53e 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -887,10 +887,11 @@ static ssize_t pktgen_if_write(struct file *file, i += len; if (debug) { - char tb[count + 1]; - if (copy_from_user(tb, user_buffer, count)) + ...
8acfe468b0384e834a303f08ebc4953d72fb690a
Analyze and fix the following issue in the Linux kernel code: net: Limit socket I/O iovec total length to INT_MAX.
Problem Details: This helps protect us from overflow issues down in the individual protocol sendmsg/recvmsg handlers. Once we hit INT_MAX we truncate out the rest of the iovec by setting the iov_len members to zero. This works because: 1) For SOCK_STREAM and SOCK_SEQPACKET sockets, partial writes are allowed and ...
```diff diff --git a/include/linux/socket.h b/include/linux/socket.h index 5146b50202ce..86b652fabf6e 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h @@ -322,7 +322,7 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata, int offset, unsigned int len, __wsum *csump); -ext...
349f6c5c5d827db909a69e5b9e844e8623c8e881
Analyze and fix the following issue in the Linux kernel code: USB: gadget: fix ethernet gadget crash in gether_setup
Problem Details: Crash is triggered by commit e6484930d7 ("net: allocate tx queues in register_netdevice"), which moved tx netqueue creation into register_netdev. So now calling netif_stop_queue() before register_netdev causes an oops. Move netif_stop_queue() after net device registration to fix crash. Signed-off-by: ...
```diff diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c index 6bb876d65252..cb23355f52d3 100644 --- a/drivers/usb/gadget/u_ether.c +++ b/drivers/usb/gadget/u_ether.c @@ -797,7 +797,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN]) * - iff DATA transfer is active, carrier is ...
fa7a5797e57d2ed71f9a6fb44f0ae42c2d7b74b7
Analyze and fix the following issue in the Linux kernel code: hwmon: (lm85) Fix ADT7468 frequency table
Problem Details: The ADT7468 uses the same frequency table as the ADT7463. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: stable@kernel.org Cc: Darrick J. Wong <djwong@us.ibm.com> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
```diff diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c index b3841a615595..2e8f0c9458d4 100644 --- a/drivers/hwmon/lm85.c +++ b/drivers/hwmon/lm85.c @@ -1259,6 +1259,7 @@ static int lm85_probe(struct i2c_client *client, switch (data->type) { case adm1027: case adt7463: + case adt7468: case emc6d100: ...
918ee91c071d6248c48bc6457a6dea286146e3ad
Analyze and fix the following issue in the Linux kernel code: hwmon: I2C addresses are constant
Problem Details: We can mark normal_i2c const. Almost all drivers do that already, so fix the 3 remaining ones before they are used as (bad) examples for new drivers. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: George Joseph <george.joseph@fairview5.com> Reviewed-by: Guenter Roeck <guenter.roeck@ericsson.com>
```diff diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c index a0c385145686..b5fcd87931cb 100644 --- a/drivers/hwmon/adt7475.c +++ b/drivers/hwmon/adt7475.c @@ -146,7 +146,7 @@ #define TEMP_OFFSET_REG(idx) (REG_TEMP_OFFSET_BASE + (idx)) #define TEMP_TRANGE_REG(idx) (REG_TEMP_TRANGE_BASE + (idx)) -stat...
5d2cd958f777e533fa2809527836996f59b2d823
Analyze and fix the following issue in the Linux kernel code: hwmon: (w83795) Fix LSB reading of voltage limits
Problem Details: Wrong index caused the wrong register value to be read, resulting in random LSB for voltage limits. Signed-off-by: Jean Delvare <khali@linux-fr.org>
```diff diff --git a/drivers/hwmon/w83795.c b/drivers/hwmon/w83795.c index e916c04e8681..9d73768060d4 100644 --- a/drivers/hwmon/w83795.c +++ b/drivers/hwmon/w83795.c @@ -1405,7 +1405,7 @@ show_in(struct device *dev, struct device_attribute *attr, char *buf) lsb_idx = IN_LSB_SHIFT_IDX[index][IN_LSB_IDX]; val <<= ...
7eb8d508b5cfabbb147670ee063438469d94c465
Analyze and fix the following issue in the Linux kernel code: hwmon: (w83795) Fix parity checks
Problem Details: x % 1 is obviously wrong, as it always evaluates to 0. You want x % 2, or x & 1, for parity checking. Signed-off-by: Jean Delvare <khali@linux-fr.org>
```diff diff --git a/drivers/hwmon/w83795.c b/drivers/hwmon/w83795.c index 71b7a254beeb..ec8a1d1f7d79 100644 --- a/drivers/hwmon/w83795.c +++ b/drivers/hwmon/w83795.c @@ -183,7 +183,7 @@ static const u8 IN_LSB_SHIFT_IDX[][2] = { #define W83795_REG_FAN_MIN_HL(index) (0xB6 + (index)) #define W83795_REG_FAN_MIN_LSB(inde...
01879a855fb6bdb3fb820344a7a145de8a5cdbda
Analyze and fix the following issue in the Linux kernel code: hwmon: (w83795) Fix PWM duty cycle frequency attributes
Problem Details: The PWM duty cycle frequenty attributes are improperly named (fanN_div instead of pwmN_div) and contain raw values instead of actual frequencies. Rename them and fix their contents. Also improve the logic when the user asks for a new frequency, to always pick the closest supported frequency. The algor...
```diff diff --git a/drivers/hwmon/w83795.c b/drivers/hwmon/w83795.c index 458fb297f696..58c61f11ed66 100644 --- a/drivers/hwmon/w83795.c +++ b/drivers/hwmon/w83795.c @@ -200,7 +200,6 @@ static const u8 IN_LSB_SHIFT_IDX[][2] = { #define W83795_REG_FCMS2 0x208 #define W83795_REG_TFMR(index) (0x202 + (index)) #defin...
6c82b2f3fb31e43a9b898769afd2151ca64986a4
Analyze and fix the following issue in the Linux kernel code: hwmon: (w83795) Fix LSB reading of fan speeds
Problem Details: Misplaced parentheses caused the wrong register value to be read, resulting in random LSB for fan speed values and limits. Signed-off-by: Jean Delvare <khali@linux-fr.org>
```diff diff --git a/drivers/hwmon/w83795.c b/drivers/hwmon/w83795.c index b797b9ce2907..24e44245e548 100644 --- a/drivers/hwmon/w83795.c +++ b/drivers/hwmon/w83795.c @@ -272,7 +272,7 @@ static inline u16 in_to_reg(u8 index, u16 val) static inline unsigned long fan_from_reg(u16 val) { - if ((val >= 0xff0) || (val =...
6f9dfd85f7b14dd3ea87106909dc54def08947b1
Analyze and fix the following issue in the Linux kernel code: hwmon: (w83795) Fix in17-in20 gain factor
Problem Details: Gain bit set means 1x gain and cleared means 8x gain, not the other way around. Signed-off-by: Jean Delvare <khali@linux-fr.org>
```diff diff --git a/drivers/hwmon/w83795.c b/drivers/hwmon/w83795.c index 62deffcc64a3..77b4f7859df9 100644 --- a/drivers/hwmon/w83795.c +++ b/drivers/hwmon/w83795.c @@ -1335,7 +1335,7 @@ show_in(struct device *dev, struct device_attribute *attr, char *buf) case IN_READ: /* calculate this value again by sensors a...
093d1a4794cc23dd221019eb1cdf42b16b48abcc
Analyze and fix the following issue in the Linux kernel code: hwmon: (w83795) Drop duplicate enum
Problem Details: Enum chips and chip_types are redundant, get rid of the former. Fix the detection code to properly identify the chip variant and name the client accordingly. Signed-off-by: Jean Delvare <khali@linux-fr.org>
```diff diff --git a/drivers/hwmon/w83795.c b/drivers/hwmon/w83795.c index 7b93ac296d03..d7e1d3693a20 100644 --- a/drivers/hwmon/w83795.c +++ b/drivers/hwmon/w83795.c @@ -38,8 +38,6 @@ /* Addresses to scan */ static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f, I2C_CLIENT_END }; -enum chips { w83795 }; - ...
62991f7ab395b57b86512d47a6017266e2e615f2
Analyze and fix the following issue in the Linux kernel code: hwmon: (s3c-hwmon) Depend on S3C_ADC
Problem Details: This way we don't need to modify Kconfig every time a new SoC comes along to make this driver support it. Also fix some typos while I'm at it. Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com> Reviewed-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Jean Delvare <khali@linux-fr.or...
```diff diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 3e88140b9d77..d875d102ee3f 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -763,14 +763,14 @@ config SENSORS_SHT15 will be called sht15. config SENSORS_S3C - tristate "S3C24XX/S3C64XX Inbuilt ADC" - depends on ARCH_S3C2410...
11e578129af74c4866cf559e62e981c6415fffd9
Analyze and fix the following issue in the Linux kernel code: hwmon: (lm90) Fix checkpatch errors
Problem Details: Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
```diff diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 760ef72eea56..aafed2898d95 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -387,8 +387,13 @@ static ssize_t set_temp8(struct device *dev, struct device_attribute *devattr, struct sensor_device_attribute *attr = to_sensor_dev_attr(d...
4aa2c466a7733af093a526e9d1cdd0b3b90d47e9
Analyze and fix the following issue in the Linux kernel code: fib: Fix fib zone and its hash leak on namespace stop
Problem Details: When we stop a namespace we flush the table and free one, but the added fn_zone-s (and their hashes if grown) are leaked. Need to free. Tries releases all its stuff in the flushing code. Shame on us - this bug exists since the very first make-fib-per-net patches in 2.6.27 :( Signed-off-by: Pavel Emel...
```diff diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index ba3666d31766..07bdb5e9e8ac 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h @@ -158,6 +158,8 @@ extern int fib_table_flush(struct fib_table *table); extern void fib_table_select_default(struct fib_table *table, const struct fl...
b1424ed91076db0b19ba4141856150df9b717dde
Analyze and fix the following issue in the Linux kernel code: cxgb3: Fix panic in free_tx_desc()
Problem Details: I got a few of these panics (on 2.6.36-rc7) when running high number of netperf sessions: BUG: unable to handle kernel paging request at 0000100000000000 IP: [<ffffffff813125f0>] skb_release_data+0xa0/0xd0 Oops: 0000 [#1] SMP Pid: 2155, comm: vhost-2115 Not tainted 2.6.36-rc7-ORG #1 49Y6512 /Syste...
```diff diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index 5d72bda54389..f9f6645b2e61 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c @@ -296,8 +296,10 @@ static void free_tx_desc(struct adapter *adapter, struct sge_txq *q, if (d->skb) { /* an SGL is present */ if (need_unmap...
69dcfc8aad24fa95ae0a0ad1405cf6847e3ec14a
Analyze and fix the following issue in the Linux kernel code: cxgb3: fix crash due to manipulating queues before registration
Problem Details: Along the same lines as "cxgb4: fix crash due to manipulating queues before registration" (8f6d9f40476895571df039b6f1f5230ec7faebad), before commit "net: allocate tx queues in register_netdevice" netif_tx_stop_all_queues and related functions could be used between device allocation and registration but...
```diff diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index 4e3c12371aae..407d4e272075 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c @@ -3301,7 +3301,6 @@ static int __devinit init_one(struct pci_dev *pdev, pi->rx_offload = T3_RX_CSUM | T3_LRO; pi-...
b7126d8c70a1d4656f1c351de8528df22dfd2d46
Analyze and fix the following issue in the Linux kernel code: 8390: Don't oops on starting dev queue
Problem Details: The __NS8390_init tries to start the device queue before the device is registered. This results in an oops (snipped): [ 2.865493] BUG: unable to handle kernel NULL pointer dereference at 0000000000000010 [ 2.866106] IP: [<ffffffffa000602a>] netif_start_queue+0xb/0x12 [8390] [ 2.881267] Call T...
```diff diff --git a/drivers/net/lib8390.c b/drivers/net/lib8390.c index 316bb70775b1..e7030ceb178b 100644 --- a/drivers/net/lib8390.c +++ b/drivers/net/lib8390.c @@ -1077,7 +1077,6 @@ static void __NS8390_init(struct net_device *dev, int startp) ei_outb_p(ei_local->rx_start_page, e8390_base + EN1_CURPAG); ei_outb_...
de7fe7874dc55e8226245c50f07dec3c7b285044
Analyze and fix the following issue in the Linux kernel code: igbvf: fix panic on load
Problem Details: Introduced by commit:e6484930d7c73d324bccda7d43d131088da697b9 net: allocate tx queues in register_netdevice Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Acked-by: Greg Rose <greg.v.rose@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.ki...
```diff diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c index ebfaa68ee630..28af019c97bb 100644 --- a/drivers/net/igbvf/netdev.c +++ b/drivers/net/igbvf/netdev.c @@ -2783,15 +2783,15 @@ static int __devinit igbvf_probe(struct pci_dev *pdev, /* reset the hardware with the new settings */ igbvf_r...
9806307a1c5a2a79e268ae4e78b437d38c8adf7f
Analyze and fix the following issue in the Linux kernel code: ixgbe: DCB, fix TX hang occurring in stress condition with PFC
Problem Details: The DCB credits refill quantum _must_ be greater than half the max packet size. This is needed to guarantee that TX DMA operations are not attempted during a pause state. Additionally, the min IFG must be set correctly for DCB mode. If a DMA operation is requested unexpectedly during the pause state th...
```diff diff --git a/drivers/net/ixgbe/ixgbe_dcb.c b/drivers/net/ixgbe/ixgbe_dcb.c index 8bb9ddb6dffe..0d44c6470ca3 100644 --- a/drivers/net/ixgbe/ixgbe_dcb.c +++ b/drivers/net/ixgbe/ixgbe_dcb.c @@ -43,9 +43,12 @@ * ixgbe_dcb_check_config(). */ s32 ixgbe_dcb_calculate_tc_credits(struct ixgbe_dcb_config *dcb_config...
affa9dfb04b7e2e3a0b0e6d844ea0c9ed97505f9
Analyze and fix the following issue in the Linux kernel code: e1000e: Add check for reset flags before displaying reset message
Problem Details: Some parts need to execute resets during normal operation. This flag check ensures that those parts reset without needlessly alarming the user. Other unexpected resets by other parts will dump debug info and message the reset action to the user, as originally intended. Signed-off-by: Carolyn Wyborny...
```diff diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 35a9dd4353d7..c4ca1629f532 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c @@ -4882,8 +4882,11 @@ static void e1000_reset_task(struct work_struct *work) struct e1000_adapter *adapter; adapter = container_...
800416f799e0723635ac2d720ad4449917a1481c
Analyze and fix the following issue in the Linux kernel code: numa: fix slab_node(MPOL_BIND)
Problem Details: When a node contains only HighMem memory, slab_node(MPOL_BIND) dereferences a NULL pointer. [ This code seems to go back all the way to commit 19770b32609b: "mm: filter based on a nodemask as well as a gfp_mask". Which was back in April 2008, and it got merged into 2.6.26. - Linus ] Signed-off-...
```diff diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 81a127643aea..4a57f135b76e 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -1597,7 +1597,7 @@ unsigned slab_node(struct mempolicy *policy) (void)first_zones_zonelist(zonelist, highest_zoneidx, &policy->v.nodes, &zone); - return zone->nod...
5af634789c93b97cfb314a102436716be8fbc577
Analyze and fix the following issue in the Linux kernel code: Staging: brcm80211: fix usage of roundup in structures
Problem Details: Now that the roundup macro is sane, it can't be used in structure definitions, or the build breaks.. For now, create a "broken_roundup()" macro to get everything building again, but in the end, fixing these structures to use a proper size value is the correct thing to do. Cc: Brett Rudley <brudley@br...
```diff diff --git a/drivers/staging/brcm80211/sys/wlc_event.c b/drivers/staging/brcm80211/sys/wlc_event.c index 7c17e5f67c5f..7e1bf0e2ecdd 100644 --- a/drivers/staging/brcm80211/sys/wlc_event.c +++ b/drivers/staging/brcm80211/sys/wlc_event.c @@ -47,7 +47,7 @@ struct wlc_eventq { bool workpending; struct wl_timer *...
eebfc6055aba312f8b620a58fe1c23471cdcd149
Analyze and fix the following issue in the Linux kernel code: Staging: bcm: fix up network device reference counting
Problem Details: The way network devices are reference counted does not include poking around in the reference count itself. This breaks when the reference count is changed to be a different type. Fix the driver to do the proper function calls instead. Cc: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Gre...
```diff diff --git a/drivers/staging/bcm/Bcmnet.c b/drivers/staging/bcm/Bcmnet.c index bb9260c6845e..bc2969821421 100644 --- a/drivers/staging/bcm/Bcmnet.c +++ b/drivers/staging/bcm/Bcmnet.c @@ -22,17 +22,15 @@ static INT bcm_notify_event(struct notifier_block *nb, ULONG event, PVOID dev) case NETDEV_REGISTER: ...
bceadddd92ceb4fd51e5e16c4f6699d8eb2e5604
Analyze and fix the following issue in the Linux kernel code: Staging: keucr: fix up US_ macro change
Problem Details: The usb tree renamed the USB storage defines to make more sense, so this driver needs the changes as well so that things will compile properly. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/staging/keucr/scsiglue.c b/drivers/staging/keucr/scsiglue.c index d830348ed011..a2671404f7ac 100644 --- a/drivers/staging/keucr/scsiglue.c +++ b/drivers/staging/keucr/scsiglue.c @@ -30,7 +30,7 @@ static int slave_alloc(struct scsi_device *sdev) blk_queue_update_dma_alignment(sdev->reque...
5f3b321da1aa5936c85ed6dec67358239a9d3cfd
Analyze and fix the following issue in the Linux kernel code: Squashfs: fix function prototype
Problem Details: The fourth argument should be unsigned. Also add missing include so that the function prototype is defined in xattr_id.c This fixes a couple of sparse warnings. Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
```diff diff --git a/fs/squashfs/xattr.h b/fs/squashfs/xattr.h index 49fe0d719fbf..b634efce4bde 100644 --- a/fs/squashfs/xattr.h +++ b/fs/squashfs/xattr.h @@ -25,7 +25,7 @@ extern __le64 *squashfs_read_xattr_id_table(struct super_block *, u64, u64 *, int *); extern int squashfs_xattr_lookup(struct super_block *, u...
07724586b44e69a08af3102be3f9afd350eda1e3
Analyze and fix the following issue in the Linux kernel code: Squashfs: fix use of __le64 annotated variable
Problem Details: This fixes a sparse with endian checking warning. Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
```diff diff --git a/fs/squashfs/xattr.c b/fs/squashfs/xattr.c index 652b8541f9c6..3876c36699a1 100644 --- a/fs/squashfs/xattr.c +++ b/fs/squashfs/xattr.c @@ -158,17 +158,18 @@ static int squashfs_xattr_get(struct inode *inode, int name_index, strncmp(target, name, name_size) == 0) { /* found xattr */ if ...
19ef20143ff86c8012270c619ac7b6c3b389a8fa
Analyze and fix the following issue in the Linux kernel code: ext4: fix compile with CONFIG_EXT4_FS_XATTR disabled
Problem Details: Commit 5dabfc78dced ("ext4: rename {exit,init}_ext4_*() to ext4_{exit,init}_*()") causes fs/ext4/super.c:4776: error: implicit declaration of function ‘ext4_init_xattr’ when CONFIG_EXT4_FS_XATTR is disabled. It renamed init_ext4_xattr to ext4_init_xattr but forgot to update the dummy definition in...
```diff diff --git a/fs/ext4/xattr.h b/fs/ext4/xattr.h index 281dd8353652..1ef16520b950 100644 --- a/fs/ext4/xattr.h +++ b/fs/ext4/xattr.h @@ -122,7 +122,7 @@ ext4_xattr_put_super(struct super_block *sb) } static __init inline int -init_ext4_xattr(void) +ext4_init_xattr(void) { return 0; } ```
e732ff707743e5ceba6ae2bfc7e799a0bac30ffa
Analyze and fix the following issue in the Linux kernel code: mmu_notifier.h: fix comment spelling
Problem Details: Signed-off-by: Figo.zhang <figo1802@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index 4e02ee2b071e..43dcfbdc39de 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h @@ -227,7 +227,7 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) /* * These two macros will sometime rep...
27d6379894be4a81984da4d48002196a83939ca9
Analyze and fix the following issue in the Linux kernel code: Fix install_process_keyring error handling
Problem Details: Fix an incorrect error check that returns 1 for error instead of the expected error code. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c index f8e7251ae2c8..504bdd2452bd 100644 --- a/security/keys/process_keys.c +++ b/security/keys/process_keys.c @@ -207,7 +207,7 @@ static int install_process_keyring(void) ret = install_process_keyring_to_cred(new); if (ret < 0) { ab...
765aaafe38050790301e89745b991dbdf3dded4c
Analyze and fix the following issue in the Linux kernel code: parisc: fix compile failure with kmap_atomic changes
Problem Details: Commit 3e4d3af501cc ("mm: stack based kmap_atomic()") overlooked the fact that parisc uses kmap as a coherence mechanism, so even though we have no highmem, we do need to supply our own versions of kmap (and atomic). This patch converts the parisc kmap to the form which is needed to keep it compiling ...
```diff diff --git a/arch/parisc/include/asm/cacheflush.h b/arch/parisc/include/asm/cacheflush.h index dba11aedce1b..f388a85bba11 100644 --- a/arch/parisc/include/asm/cacheflush.h +++ b/arch/parisc/include/asm/cacheflush.h @@ -126,20 +126,20 @@ static inline void *kmap(struct page *page) #define kunmap(page) kunma...