id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
2b72c7849f9a091c1e5d7255732faf14ac7d5123
Analyze and fix the following issue in the Linux kernel code: qlge: bugfix: Fix shadow register endian issue.
Problem Details: Shadow registers are consistent memory locations to which the chip echos ring indexes in little endian format. These values need to be endian swapped before referencing. Note: The register pointer declaration uses the volatile modifier which causes warnings in checkpatch. Per Documentation/volatile-c...
```diff diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h index ba2e1c5b6bcf..97321bb9600e 100644 --- a/drivers/net/qlge/qlge.h +++ b/drivers/net/qlge/qlge.h @@ -1189,7 +1189,7 @@ struct rx_ring { u32 cq_size; u32 cq_len; u16 cq_id; - u32 *prod_idx_sh_reg; /* Shadowed producer register. */ + volatile...
4055c7d495f2502718bbbea871e6504ae95add14
Analyze and fix the following issue in the Linux kernel code: qlge: bugfix: Add missing pci_unmap_page call in receive path.
Problem Details: Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index c6ab6a493e70..9ceedfc4b56a 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c @@ -1308,6 +1308,11 @@ static struct sk_buff *ql_build_rx_skb(struct ql_adapter *qdev, "No skb available, drop the packet.\...
c907a35acf0e964dfd0753519b3dc7689727e175
Analyze and fix the following issue in the Linux kernel code: qlge: bugfix: Add missing pci_mapping_err checking.
Problem Details: Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 718a7bd0cd1a..c6ab6a493e70 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c @@ -963,6 +963,11 @@ static void ql_update_sbq(struct ql_adapter *qdev, struct rx_ring *rx_ring) sbq_desc->p.skb->dat...
22692018b93f0782cda5a843cecfffda1854eb8d
Analyze and fix the following issue in the Linux kernel code: enc28j60: fix RX buffer overflow
Problem Details: The enc28j60 driver doesn't check whether the length of the packet as reported by the hardware fits into the preallocated buffer. When stressed, the hardware may report insanely large packets even tough the "Receive OK" bit is set. Fix this. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-of...
```diff diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index b0ef46c51a9d..cefe1d98f93e 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c @@ -944,7 +944,7 @@ static void enc28j60_hw_rx(struct net_device *ndev) if (netif_msg_rx_status(priv)) enc28j60_dump_rsv(priv, __func__, next_packet...
14eaddc967b16017d4a1a24d2be6c28ecbe06ed8
Analyze and fix the following issue in the Linux kernel code: CRED: Fix regression in cap_capable() as shown up by sys_faccessat() [ver #2]
Problem Details: Fix a regression in cap_capable() due to: commit 5ff7711e635b32f0a1e558227d030c7e45b4a465 Author: David Howells <dhowells@redhat.com> Date: Wed Dec 31 02:52:28 2008 +0000 CRED: Differentiate objective and effective subjective credentials on a task The problem is that the above patch allows...
```diff diff --git a/include/linux/capability.h b/include/linux/capability.h index e22f48c2a46f..5b8a13214451 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h @@ -529,8 +529,21 @@ extern const kernel_cap_t __cap_init_eff_set; * * Note that this does not set PF_SUPERPRIV on the task. */ -#d...
14deae41566b5cdd992c01d0069518ced5227c83
Analyze and fix the following issue in the Linux kernel code: ipv6: Fix sporadic sendmsg -EINVAL when sending to multicast groups.
Problem Details: Thanks to excellent diagnosis by Eduard Guzovsky. The core problem is that on a network with lots of active multicast traffic, the neighbour cache can fill up. If we try to allocate a new route and thus neighbour cache entry, the bog-standard GC attempt the neighbour layer does in ineffective because...
```diff diff --git a/include/net/ndisc.h b/include/net/ndisc.h index ce532f2222ce..1459ed3e2697 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h @@ -155,9 +155,9 @@ static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, const s { if (dev) - return __neigh_lookup(&nd_tbl, addr, dev, 1);...
2e9f3bddcbc711bb14d86c6f068a779bf3710247
Analyze and fix the following issue in the Linux kernel code: bzip2/lzma: make config machinery an arch configurable
Problem Details: Impact: Bug fix (we should not show this menu on irrelevant architectures) Make the config machinery to drive the gzip/bzip2/lzma selection dependent on the architecture advertising HAVE_KERNEL_* so that we don't display this for architectures where it doesn't matter. Signed-off-by: H. Peter Anvin <h...
```diff diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 862adb9bf0d4..7b66c34d0aae 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -39,6 +39,9 @@ config X86 select HAVE_GENERIC_DMA_COHERENT if X86_32 select HAVE_EFFICIENT_UNALIGNED_ACCESS select USER_STACKTRACE_SUPPORT + select HAVE_KERNEL_GZIP + s...
0f5e2d2484ccd3062bb1f63083bafa37041bc868
Analyze and fix the following issue in the Linux kernel code: bzip2/lzma: handle failures from bzip2 and lzma correctly
Problem Details: Impact: Bug fix If bzip2 or lzma fails (for example, if they aren't installed on the system), we need to propagate the failure out to "make". However, they were masked by being followed by a semicolon. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
```diff diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 70b4676e3b99..3b949a354470 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -193,10 +193,10 @@ cmd_gzip = gzip -f -9 < $< > $@ size_append=$(CONFIG_SHELL) $(srctree)/scripts/bin_size quiet_cmd_bzip2 = BZIP2 $@ -cmd_bzip2 = (bzi...
d6f95a3d14dc403881b23ad268ec1e3600c4e6b4
Analyze and fix the following issue in the Linux kernel code: firewire: fix resetting of bus manager retry counter
Problem Details: An earlier change, maybe long ago, removed the copying of self_id_count into card->self_id_count. Since then each bus reset cleared card->bm_retries even when it shouldn't. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
```diff diff --git a/drivers/firewire/fw-topology.c b/drivers/firewire/fw-topology.c index 7687dca1a690..c9be6e6948c4 100644 --- a/drivers/firewire/fw-topology.c +++ b/drivers/firewire/fw-topology.c @@ -355,6 +355,9 @@ report_lost_node(struct fw_card *card, { fw_node_event(card, node, FW_NODE_DESTROYED); fw_node_p...
d6053e08f5520dcb58c200d2e1861d9c505b72e8
Analyze and fix the following issue in the Linux kernel code: firewire: fix small memory leak at module removal
Problem Details: Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
```diff diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c index 6b9be42c7b98..31b6c74d34df 100644 --- a/drivers/firewire/fw-device.c +++ b/drivers/firewire/fw-device.c @@ -617,7 +617,7 @@ static int shutdown_unit(struct device *device, void *data) */ DECLARE_RWSEM(fw_device_rwsem); -static D...
c82cdea1e1cb3790788d04ef5cab33488e1455c9
Analyze and fix the following issue in the Linux kernel code: ieee1934: dv1394: interrupt enabling/disabling broken on big-endian
Problem Details: After annotating the frame structs, this was left: drivers/ieee1394/dv1394.c:2113:23: warning: invalid assignment: |= drivers/ieee1394/dv1394.c:2113:23: left side has type restricted __le32 drivers/ieee1394/dv1394.c:2113:23: right side has type int drivers/ieee1394/dv1394.c:2121:24: warning: inva...
```diff diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c index f258e618389c..a329e6bd5d2d 100644 --- a/drivers/ieee1394/dv1394.c +++ b/drivers/ieee1394/dv1394.c @@ -2110,17 +2110,17 @@ static void ir_tasklet_func(unsigned long data) f = video->frames[next_i / MAX_PACKETS]; next = &(f->descript...
0bed1819687b50a769a1fee6d91cb0ef79b011b4
Analyze and fix the following issue in the Linux kernel code: ieee1394: ignore nonzero Bus_Info_Block.max_rom, fetch config ROM in quadlets
Problem Details: It is already known that buggy firmwares exist which report a bogus link_spd in their config ROM bus info block. We now got the first report of a bogus max_rom too (Freecom FireWire Hard Drive 1TB, http://bugzilla.kernel.org/show_bug.cgi?id=12206). I suspect other OSs only use quadlet reads to fetch ...
```diff diff --git a/drivers/ieee1394/csr1212.c b/drivers/ieee1394/csr1212.c index 5e38a68b8af2..a6dfeb0b3372 100644 --- a/drivers/ieee1394/csr1212.c +++ b/drivers/ieee1394/csr1212.c @@ -1077,15 +1077,10 @@ static int csr1212_parse_bus_info_block(struct csr1212_csr *csr) int i; int ret; - /* IEEE 1212 says that t...
d1069aea6840c24f6e0617a758334312b60d3fc6
Analyze and fix the following issue in the Linux kernel code: ieee1394: ohci1394: don't leave interrupts enabled during suspend/resume
Problem Details: On my HP 2510p I get the following in dmesg during near the end of most resumes from suspend to RAM: irq 19: nobody cared (try booting with the "irqpoll" option) Pid: 0, comm: swapper Not tainted 2.6.28-rc7 #67 Call Trace: <IRQ> [<ffffffffa00ee9e1>] ? ohci_irq_handler+0x60/0x7e9 [ohci1394] [<ffffff...
```diff diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c index e509e13cb7a7..066726bcb0ee 100644 --- a/drivers/ieee1394/ohci1394.c +++ b/drivers/ieee1394/ohci1394.c @@ -3381,6 +3381,7 @@ static int ohci1394_pci_suspend(struct pci_dev *dev, pm_message_t state) ohci_devctl(ohci->host, RESET_BUS, L...
c298be74492bece102f3379d14015638f1fd1fac
Analyze and fix the following issue in the Linux kernel code: parisc: fix module loading failure of large kernel modules
Problem Details: On 32bit (and sometimes 64bit) and with big kernel modules like xfs or ipv6 the relocation types R_PARISC_PCREL17F and R_PARISC_PCREL22F may fail to reach their PLT stub if we only create one big stub array for all sections at the beginning of the core or init section. With this patch we now instead a...
```diff diff --git a/arch/parisc/include/asm/module.h b/arch/parisc/include/asm/module.h index c2cb49e934c1..1f4123427ea0 100644 --- a/arch/parisc/include/asm/module.h +++ b/arch/parisc/include/asm/module.h @@ -23,8 +23,10 @@ struct mod_arch_specific { unsigned long got_offset, got_count, got_max; unsigned long fd...
088af9a6e05d51e7c3dc85d45d8b7a52c3ee08d7
Analyze and fix the following issue in the Linux kernel code: module: fix module loading failure of large kernel modules for parisc
Problem Details: When creating the final layout of a kernel module in memory, allow the module loader to reserve some additional memory in front of a given section. This is currently only needed for the parisc port which needs to put the stub entries there to fulfill the 17/22bit PCREL relocations with large kernel mod...
```diff diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h index eb1033957486..c1f40c2f7ffb 100644 --- a/include/linux/moduleloader.h +++ b/include/linux/moduleloader.h @@ -13,6 +13,9 @@ int module_frob_arch_sections(Elf_Ehdr *hdr, char *secstrings, struct module *mod); +/* A...
d1e99d7ae4e6bbd1ebb5e81ecd3af2b8793efee0
Analyze and fix the following issue in the Linux kernel code: module: fix warning of unused function when !CONFIG_PROC_FS
Problem Details: Fix this warning: kernel/module.c:824: warning: ‘print_unload_info’ defined but not used print_unload_info() just was used when CONFIG_PROC_FS was defined. This patch mark print_unload_info() inline to solve the problem. Signed-off-by: Jianjun Kong <jianjun@zeuux.org> Signed-off-by: Rusty Russell <rus...
```diff diff --git a/kernel/module.c b/kernel/module.c index 895c5675edb7..d3d254571bda 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -820,7 +820,7 @@ sys_delete_module(const char __user *name_user, unsigned int flags) return ret; } -static void print_unload_info(struct seq_file *m, struct module *mod) +st...
ca4787b779dd698a2a33a328aa5fa90a3e954077
Analyze and fix the following issue in the Linux kernel code: kernel/module.c: compare symbol values when marking symbols as exported in /proc/kallsyms.
Problem Details: When there are two symbols in a module with the same name, one of which is exported, both will be marked as exported in /proc/kallsyms. There aren't any instances of this in the current kernel, but it is easy to construct a simple module with two compilation units that exhibits the problem. $ objdump...
```diff diff --git a/kernel/module.c b/kernel/module.c index dd2a54155b54..895c5675edb7 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -1725,15 +1725,15 @@ static const struct kernel_symbol *lookup_symbol(const char *name, return NULL; } -static int is_exported(const char *name, const struct module *mod) +s...
54566b2c1594c2326a645a3551f9d989f7ba3c5e
Analyze and fix the following issue in the Linux kernel code: fs: symlink write_begin allocation context fix
Problem Details: With the write_begin/write_end aops, page_symlink was broken because it could no longer pass a GFP_NOFS type mask into the point where the allocations happened. They are done in write_begin, which would always assume that the filesystem can be entered from reclaim. This bug could cause filesystem dea...
```diff diff --git a/fs/affs/file.c b/fs/affs/file.c index 1377b1240b6e..9246cb4aa018 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c @@ -628,7 +628,7 @@ static int affs_write_begin_ofs(struct file *file, struct address_space *mapping } index = pos >> PAGE_CACHE_SHIFT; - page = __grab_cache_page(mapping, index);...
e687d691cb3790d25e31c74f5941fd7c565e9df5
Analyze and fix the following issue in the Linux kernel code: viafb: fix crashes due to 4k stack overflow
Problem Details: The function viafb_cursor() uses 2 stack-variables of CURSOR_SIZE bits; CURSOR_SIZE is defined as (8 * 1024). Using up twice 1k on stack is too much for 4k-stack (though it works with 8k-stacks). Make those two variables kzalloc'ed to preserve stack space. Also merge the whole lot of local struct's ...
```diff diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 73ac754ad801..e21fe5b6f9ff 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c @@ -546,23 +546,25 @@ static int viafb_blank(int blank_mode, struct fb_info *info) static int viafb_ioctl(struct fb_info *info...
2e4e27c7d082b2198b63041310609d7191185a9d
Analyze and fix the following issue in the Linux kernel code: vmalloc.c: fix flushing in vmap_page_range()
Problem Details: The flush_cache_vmap in vmap_page_range() is called with the end of the range twice. The following patch fixes this for me. Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundatio...
```diff diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 1ddb77ba3995..7465f22fec0c 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -151,11 +151,12 @@ static int vmap_pud_range(pgd_t *pgd, unsigned long addr, * * Ie. pte at addr+N*PAGE_SIZE shall point to pfn corresponding to pages[N] */ -static int vmap_page_range...
7b574b7b0124ed344911f5d581e9bc2d83bbeb19
Analyze and fix the following issue in the Linux kernel code: cgroups: fix a race between cgroup_clone and umount
Problem Details: The race is calling cgroup_clone() while umounting the ns cgroup subsys, and thus cgroup_clone() might access invalid cgroup_fs, or kill_sb() is called after cgroup_clone() created a new dir in it. The BUG I triggered is BUG_ON(root->number_of_cgroups != 1); ------------[ cut here ]------------ k...
```diff diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 48348dde6d81..891a84eb9d30 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -2945,7 +2945,11 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys, parent = task_cgroup(tsk, subsys->subsys_id); /* Pin the hierarchy */ - atomic_i...
e45aa212ea81d39b38ba158df344dc3a500153e5
Analyze and fix the following issue in the Linux kernel code: audit rules ordering, part 2
Problem Details: Fix the actual rule listing; add per-type lists _not_ used for matching, with all exit,... sitting on one such list. Simplifies "do something for all rules" logics, while we are at it... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
```diff diff --git a/include/linux/audit.h b/include/linux/audit.h index 5b47eeb00d53..cc71fdb56ae2 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h @@ -373,6 +373,7 @@ struct audit_krule { struct audit_watch *watch; /* associated watch */ struct audit_tree *tree; /* associated watched tree */ struc...
8a87dd9a20ca895527b039e64e54adcbc64b256a
Analyze and fix the following issue in the Linux kernel code: x86: setup_percpu.c fix style problems
Problem Details: Impact: cleanup Fix: WARNING: Use #include <linux/smp.h> instead of <asm/smp.h> WARNING: Use #include <linux/percpu.h> instead of <asm/percpu.h> WARNING: Use #include <linux/topology.h> instead of <asm/topology.h> WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable ERROR...
```diff diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c index 0b63b08e7530..c73d9a815b6d 100644 --- a/arch/x86/kernel/setup_percpu.c +++ b/arch/x86/kernel/setup_percpu.c @@ -5,12 +5,11 @@ #include <linux/percpu.h> #include <linux/kexec.h> #include <linux/crash_dump.h> -#include <asm/smp....
f50cec36403674ca39663f44b6a491daa1731920
Analyze and fix the following issue in the Linux kernel code: x86: irqinit_64.c fix style problems
Problem Details: Impact: cleanup, fix style problems Fix: WARNING: Use #include <linux/acpi.h> instead of <asm/acpi.h> WARNING: Use #include <linux/io.h> instead of <asm/io.h> WARNING: Use #include <linux/delay.h> instead of <asm/delay.h> total: 0 errors, 3 warnings Signed-off-by: Jaswinder Singh Rajput <jaswin...
```diff diff --git a/arch/x86/kernel/irqinit_64.c b/arch/x86/kernel/irqinit_64.c index 31ebfe38e96c..cb875a63867d 100644 --- a/arch/x86/kernel/irqinit_64.c +++ b/arch/x86/kernel/irqinit_64.c @@ -11,14 +11,14 @@ #include <linux/kernel_stat.h> #include <linux/sysdev.h> #include <linux/bitops.h> +#include <linux/acpi.h...
aa09e6cdae4c60c3070176498abf99b81e1b40fe
Analyze and fix the following issue in the Linux kernel code: x86: irqinit_32.c fix style problems
Problem Details: Impact: cleanup Fix: WARNING: Use #include <linux/io.h> instead of <asm/io.h> WARNING: Use #include <linux/delay.h> instead of <asm/delay.h> ERROR: trailing whitespace WARNING: externs should be avoided in .c files ERROR: space required after that ',' (ctx:VxV) WARNING: space prohibited between...
```diff diff --git a/arch/x86/kernel/irqinit_32.c b/arch/x86/kernel/irqinit_32.c index 84723295f88a..1507ad4e674d 100644 --- a/arch/x86/kernel/irqinit_32.c +++ b/arch/x86/kernel/irqinit_32.c @@ -9,18 +9,18 @@ #include <linux/kernel_stat.h> #include <linux/sysdev.h> #include <linux/bitops.h> +#include <linux/io.h> +#...
7bafaf306769348723471e133adaa57238770492
Analyze and fix the following issue in the Linux kernel code: x86: i8259.c fix style problems
Problem Details: Impact: cleanup Fix: WARNING: Use #include <linux/acpi.h> instead of <asm/acpi.h> WARNING: Use #include <linux/io.h> instead of <asm/io.h> WARNING: Use #include <linux/delay.h> instead of <asm/delay.h> ERROR: code indent should use tabs where possible total: 1 errors, 3 warnings Signed-off-by:...
```diff diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c index 4b8a53d841f7..11d5093eb281 100644 --- a/arch/x86/kernel/i8259.c +++ b/arch/x86/kernel/i8259.c @@ -11,15 +11,15 @@ #include <linux/kernel_stat.h> #include <linux/sysdev.h> #include <linux/bitops.h> +#include <linux/acpi.h> +#include <linux/i...
72ade5f9ca7b384a180ae6b42987f627acd9fe95
Analyze and fix the following issue in the Linux kernel code: x86: irq_32.c fix style problems
Problem Details: Impact: cleanup Fix: WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h> ERROR: "(foo*)" should be "(foo *)" ERROR: space required after that ',' (ctx:VxV) total: 5 errors, 1 warnings Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Signed-off-by: Ingo Molnar <min...
```diff diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c index 9dc5588f336a..74b9ff7341e9 100644 --- a/arch/x86/kernel/irq_32.c +++ b/arch/x86/kernel/irq_32.c @@ -15,9 +15,9 @@ #include <linux/notifier.h> #include <linux/cpu.h> #include <linux/delay.h> +#include <linux/uaccess.h> #include <asm/api...
d3b66bf2e18777e8389742a38efbd06becfa4775
Analyze and fix the following issue in the Linux kernel code: ia64: cpumask fix for is_affinity_mask_valid()
Problem Details: Impact: cleanup The function prototype should use 'struct cpumask *' to declare cpumask arguments (instead of cpumask_var_t). Note: arch/ia64/kernel/irq.c still had the following "old cpumask_t" usages: 105: cpumask_t mask = CPU_MASK_NONE; 107: cpu_set(cpu_logical_id(hwid), mask); 110: ...
```diff diff --git a/arch/ia64/include/asm/irq.h b/arch/ia64/include/asm/irq.h index 36429a532630..5282546cdf82 100644 --- a/arch/ia64/include/asm/irq.h +++ b/arch/ia64/include/asm/irq.h @@ -27,7 +27,7 @@ irq_canonicalize (int irq) } extern void set_irq_affinity_info (unsigned int irq, int dest, int redir); -bool i...
3f874b6643e189d3d07618928ceed0013d71593e
Analyze and fix the following issue in the Linux kernel code: mfd: Fix section mismatch in da903x
Problem Details: The subdevice removal functions are marked __devexit but are referenced from the error handling path when probing so are needed even when __devexit functions are removed. Signed-off-by: Mark Brown <broonie@sirena.org.uk> Acked-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Samuel Ortiz <sameo@op...
```diff diff --git a/drivers/mfd/da903x.c b/drivers/mfd/da903x.c index fcaf1f6028dd..99f8dcfe3d98 100644 --- a/drivers/mfd/da903x.c +++ b/drivers/mfd/da903x.c @@ -447,13 +447,13 @@ static const struct i2c_device_id da903x_id_table[] = { }; MODULE_DEVICE_TABLE(i2c, da903x_id_table); -static int __devexit __remove_su...
8916edef5888c5d8fe283714416a9ca95b4c3431
Analyze and fix the following issue in the Linux kernel code: getrusage: RUSAGE_THREAD should return ru_utime and ru_stime
Problem Details: Impact: task stats regression fix Original getrusage(RUSAGE_THREAD) implementation can return ru_utime and ru_stime. But commit "f06febc: timers: fix itimer/many thread hang" broke it. this patch restores it. Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Acked-by: Roland McGrath <r...
```diff diff --git a/kernel/sys.c b/kernel/sys.c index d356d79e84ac..61dbfd4a54df 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -1627,6 +1627,8 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r) utime = stime = cputime_zero; if (who == RUSAGE_THREAD) { + utime = task_utime(current); +...
5866e1b49dd2cdc9024e2269e7b1201a57bf9e19
Analyze and fix the following issue in the Linux kernel code: x86: ioport.c fix style problems
Problem Details: Impact: cleanup Fix: ERROR: "foo * bar" should be "foo *bar" total: 2 errors, 0 warnings Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c index 191914302744..b12208f4dfee 100644 --- a/arch/x86/kernel/ioport.c +++ b/arch/x86/kernel/ioport.c @@ -35,8 +35,8 @@ static void set_bitmap(unsigned long *bitmap, unsigned int base, */ asmlinkage long sys_ioperm(unsigned long from, unsigned ...
fe331184a33bf0458a04e8fb3d5c006e6520a871
Analyze and fix the following issue in the Linux kernel code: x86: time_64.c fix style problems
Problem Details: Impact: cleanup Fix: WARNING: Use #include <linux/nmi.h> instead of <asm/nmi.h> total: 0 errors, 1 warnings Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/kernel/time_64.c b/arch/x86/kernel/time_64.c index 891e7a7c4334..e6e695acd725 100644 --- a/arch/x86/kernel/time_64.c +++ b/arch/x86/kernel/time_64.c @@ -17,10 +17,10 @@ #include <linux/module.h> #include <linux/time.h> #include <linux/mca.h> +#include <linux/nmi.h> #include <asm/i825...
69036c8cc29465f866f352199534be603acc79dd
Analyze and fix the following issue in the Linux kernel code: x86: time_32.c fix style problems
Problem Details: Impact: cleanup Fix: ERROR: space prohibited after that open parenthesis '(' ERROR: space prohibited before that close parenthesis ')' total: 4 errors, 0 warnings Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/kernel/time_32.c b/arch/x86/kernel/time_32.c index 65309e4cb1c0..3985cac0ed47 100644 --- a/arch/x86/kernel/time_32.c +++ b/arch/x86/kernel/time_32.c @@ -105,8 +105,8 @@ irqreturn_t timer_interrupt(int irq, void *dev_id) high bit of the PPI port B (0x61). Note that some PS/2s, notabl...
5f66b2a0d919e84ee921dc21c9dbfddd1215c0e9
Analyze and fix the following issue in the Linux kernel code: x86: irq_64.c fix style problems
Problem Details: Impact: cleanup, fix style problems, more readable Fix: WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h> WARNING: Use #include <linux/smp.h> instead of <asm/smp.h> ERROR: code indent should use tabs where possible total: 9 errors, 2 warnings Signed-off-by: Jaswinder Singh Rajp...
```diff diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c index 6383d50f82ea..63c88e6ec025 100644 --- a/arch/x86/kernel/irq_64.c +++ b/arch/x86/kernel/irq_64.c @@ -14,10 +14,10 @@ #include <linux/module.h> #include <linux/delay.h> #include <linux/ftrace.h> -#include <asm/uaccess.h> +#include <linux/ua...
6a02e71099a87d13f2aa49cb491b5bfb5e662fae
Analyze and fix the following issue in the Linux kernel code: x86: irq.c fix style problems
Problem Details: Impact: cleanup Fix: WARNING: Use #include <linux/smp.h> instead of <asm/smp.h> total: 0 errors, 1 warnings Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index bce53e1352a0..3973e2df7f87 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -5,10 +5,10 @@ #include <linux/interrupt.h> #include <linux/kernel_stat.h> #include <linux/seq_file.h> +#include <linux/smp.h> #include <asm/apic.h>...
60d53c305805fcb612d3982dfef5c9e678e27f42
Analyze and fix the following issue in the Linux kernel code: x86: traps.c fix style problems
Problem Details: Impact: cleanup Fix: WARNING: Use #include <linux/nmi.h> instead of <asm/nmi.h> WARNING: Use #include <linux/smp.h> instead of <asm/smp.h> WARNING: Use #include <linux/io.h> instead of <asm/io.h> total: 0 errors, 3 warnings Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Signe...
```diff diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index ce6650eb64e9..25d5c3073582 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -65,9 +65,6 @@ #else #include <asm/processor-flags.h> #include <asm/arch_hooks.h> -#include <asm/nmi.h> -#include <asm/smp.h> -#include <asm/io...
befa9e780d49f23b051a1ad96881274ceb275ae5
Analyze and fix the following issue in the Linux kernel code: x86: process_32.c fix style problems
Problem Details: Impact: cleanup Fix: WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h> WARNING: Use #include <linux/io.h> instead of <asm/io.h> WARNING: Use #include <linux/kdebug.h> instead of <asm/kdebug.h> WARNING: Use #include <linux/smp.h> instead of <asm/smp.h> ERROR: "foo * bar" should b...
```diff diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 3ba155d24884..a546f55c77b4 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c @@ -39,11 +39,12 @@ #include <linux/prctl.h> #include <linux/dmi.h> #include <linux/ftrace.h> +#include <linux/uaccess.h> +#in...
e423e33ec100a4a21943f6535e9971bb3aacfe38
Analyze and fix the following issue in the Linux kernel code: x86: apic.c fix style problems
Problem Details: Impact: cleanup Fix: WARNING: Use #include <linux/smp.h> instead of <asm/smp.h> WARNING: Use #include <linux/nmi.h> instead of <asm/nmi.h> WARNING: Use #include <linux/timex.h> instead of <asm/timex.h> WARNING: line over 80 characters ERROR: else should follow close brace '}' total: 2 errors, ...
```diff diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c index d652515e2855..f314304ed06d 100644 --- a/arch/x86/kernel/apic.c +++ b/arch/x86/kernel/apic.c @@ -31,9 +31,11 @@ #include <linux/dmi.h> #include <linux/dmar.h> #include <linux/ftrace.h> +#include <linux/smp.h> +#include <linux/nmi.h> +#include ...
6354ab5c63bc986bf539026a1b289cc142f6e87c
Analyze and fix the following issue in the Linux kernel code: mfd: Fix twl4030-core.c build error
Problem Details: This is a fix for: twl4030-core.c:(.text+0x16a797): undefined reference to `clk_get_rate' twl4030-core.c:(.text+0x16a797): undefined reference to `clk_put' on x86 and x86_64, as the clock API is not defined on those platforms. Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
```diff diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c index fdfbd313ae09..b59c385cbc12 100644 --- a/drivers/mfd/twl4030-core.c +++ b/drivers/mfd/twl4030-core.c @@ -658,12 +658,7 @@ static void __init clocks_init(void) osc = clk_get(NULL, "osc_ck"); else osc = clk_get(NULL, "osc_sys_ck"); ...
b73eac7871d002835be17d4602cced2c15c0db4b
Analyze and fix the following issue in the Linux kernel code: mfd: twl4030 regulator bug fixes
Problem Details: This contains two bugfixes to the initial twl4030 regulator support patch related to USB: (a) always overwrite the old list of consumers ... else the regulator handles all use the same "usb1v5" name; (b) don't set up the "usbcp" regulator, which turns out to be managed through separate con...
```diff diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c index 8ab9ee8543a6..fdfbd313ae09 100644 --- a/drivers/mfd/twl4030-core.c +++ b/drivers/mfd/twl4030-core.c @@ -433,7 +433,7 @@ add_regulator_linked(int num, struct regulator_init_data *pdata, if (!pdata) return NULL; - if (consumers && !...
b797a5551979da22b0a35632198ffc8a330d9537
Analyze and fix the following issue in the Linux kernel code: mfd: Refactor WM8350 chip identification
Problem Details: Since the WM8350 driver was originally written the semantics for the identification registers of the chip have been clarified, allowing us to do an exact match on all the fields. This avoids mistakenly running on unsupported hardware. Also change to using the datasheet names more consistently for legi...
```diff diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c index 764bf15ea684..2188d759cbde 100644 --- a/drivers/mfd/wm8350-core.c +++ b/drivers/mfd/wm8350-core.c @@ -1227,52 +1227,72 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq, struct wm8350_platform_data *pdata) { int ret = -...
c66b9906f863696159e05890bb7123269bb9a9de
Analyze and fix the following issue in the Linux kernel code: intel-iommu: fix build error with INTR_REMAP=y and DMAR=n
Problem Details: dmar.o can be built in the CONFIG_INTR_REMAP=y case but iommu_calculate_agaw() is only available if VT-d is built as well. So create an inline version of iommu_calculate_agaw() for the !CONFIG_DMAR case. The iommu->agaw value wont be used in this case, but the code is cleaner (has less #ifdefs) if we ...
```diff diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h index 136f170cecc2..af1dab41674b 100644 --- a/include/linux/dma_remapping.h +++ b/include/linux/dma_remapping.h @@ -17,7 +17,15 @@ struct dmar_domain; struct root_entry; extern void free_dmar_iommu(struct intel_iommu *iommu); + +#ifd...
7aed55d1085f71241284a30af0300feea48c36db
Analyze and fix the following issue in the Linux kernel code: x86: fix RIP printout in early_idt_handler
Problem Details: Impact: fix debug/crash printout Since errorcode is popped out, RIP is on the top of the stack. Use real RIP value instead of wrong CS. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: <stable@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index 26cfdc1d7c7f..0e275d495563 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S @@ -305,7 +305,7 @@ ENTRY(early_idt_handler) call dump_stack #ifdef CONFIG_KALLSYMS leaq early_idt_ripmsg(%rip),%rdi - movq 8(%rsp),%rs...
4dfdc46468a142216b284eea66040f49df3f7191
Analyze and fix the following issue in the Linux kernel code: HID: fix error condition propagation in hid-sony driver
Problem Details: sony_set_operational() only propagates return value from usb_control_msg(), which returns negative on error and number of transferred bytes otherwise. Reported-by: Marcin Tolysz <tolysz@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
```diff diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 86e563b8d644..dd5a3979a4de 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -102,7 +102,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) } ret = sony_set_operational(hdev); - if (ret) +...
b8a832b1c0a70531b4bd69a67aa0bf72f6f2dc34
Analyze and fix the following issue in the Linux kernel code: HID: fix reference count leak hidraw
Problem Details: The hidraw subsystem has a bug that prevents the close syscall from ever reaching the low level driver, leading to a resource leak. Fix by replacing postdecrement with predecrement. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
```diff diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index 7685ae6808c4..96ec1bacbbf3 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c @@ -208,7 +208,7 @@ static int hidraw_release(struct inode * inode, struct file * file) list_del(&list->node); dev = hidraw_table[minor]; - if (!dev->open-...
25e61613cf3ca7f6d5f89a707b20c9eed6b74455
Analyze and fix the following issue in the Linux kernel code: HID: add proper support for pensketch 12x9 tablet
Problem Details: The Genius PenSketch 12x9 tablet has a puck (labeled a "Tablet Mouse") in addition to a pen. Without registering a quirk the tablet appears to be a single input device that reports the wrong axis information in /proc/bus/input/devices, and sends incorrect events (e.g. ABS_Z instead of ABS_Y). This info...
```diff diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 1fe0b8bae1b7..63aaa0ff3971 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -389,6 +389,9 @@ #define USB_VENDOR_ID_TURBOX 0x062a #define USB_DEVICE_ID_TURBOX_KEYBOARD 0x0201 +#define USB_VENDOR_ID_UCLOGIC 0x5543 +#define USB...
1db489b2953799d41098a891c85dea02e3c4721a
Analyze and fix the following issue in the Linux kernel code: HID: fix default Kconfig setting for TopSpeed driver
Problem Details: Make default setting for TopSpeed driver compliant with the defaults of the other specialized HID drivers. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
```diff diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 4c65e75d5b8d..e85c8fe9ffcf 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig @@ -249,7 +249,7 @@ config GREENASIA_FF config HID_TOPSEED tristate "TopSeed Cyberlink remote control support" if EMBEDDED depends on USB_HID - default y + defa...
725cf0f47dbb02e0482f081828cff73f55479b79
Analyze and fix the following issue in the Linux kernel code: HID: avoid sparse warning in HID_COMPAT_LOAD_DRIVER
Problem Details: Impact: include a prototype for the exported function in the macro Fix about 20 of this warnings: drivers/hid/hid-a4tech.c:162:1: warning: symbol 'hid_compat_a4tech' was not declared. Should it be static? Signed-off-by: Hannes Eder <hannes@hanneseder.net> Signed-off-by: Jiri Kosina <jkosina@suse.c...
```diff diff --git a/include/linux/hid.h b/include/linux/hid.h index 215035bbb288..81aa84d60c6b 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -793,6 +793,8 @@ dbg_hid(const char *fmt, ...) #ifdef CONFIG_HID_COMPAT #define HID_COMPAT_LOAD_DRIVER(name) \ +/* prototype to avoid sparse warning */ \ +ext...
079034073faf974973baa0256b029451f6e768ad
Analyze and fix the following issue in the Linux kernel code: HID: hiddev cleanup -- handle all error conditions properly
Problem Details: This is a cleanup of hiddev and fixes the following issues: - thread safety by locking in read & ioctl, introducing a per device mutex - race between ioctl and disconnect, introducing a flag and locking in form of a per low level device mutex - race between open and other methods, making sure only s...
```diff diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index 83e851a5ed30..6a98f9f572b0 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c @@ -49,6 +49,7 @@ struct hiddev { int exist; int open; + struct mutex existancelock; wait_queue_head_t wait; struct hid_devi...
d04b431e3d769fbbf26c4f4072002375c8cc4ed9
Analyze and fix the following issue in the Linux kernel code: HID: switch specialized drivers from "default y" to !EMBEDDED
Problem Details: Fix the obnoxious "default y" for all the "special" HID code, which forces folk with EMBEDDED defined to manually override that inappropriate default for almost 20 choices. The general policy is against "default y"; it should apply here too. Signed-off-by: David Brownell <dbrownell@users.sourceforge....
```diff diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index aadef9abc05d..1033129d4767 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig @@ -85,14 +85,14 @@ config HID_COMPAT config HID_A4TECH tristate "A4 tech" if EMBEDDED depends on USB_HID - default y + default !EMBEDDED ---help--- Support...
d97106ab53f812910a62d18afb9dbe882819c1ba
Analyze and fix the following issue in the Linux kernel code: Make %p print '(null)' for NULL pointers
Problem Details: Before, when we only ever printed out the pointer value itself, a NULL pointer would never cause issues and might as well be printed out as just its numeric value. However, with the extended %p formats, especially %pR, we might validly want to print out resources for debugging. And sometimes they don...
```diff diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 3b777025d876..98d632277ca8 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -661,6 +661,9 @@ static char *ip4_addr_string(char *buf, char *end, u8 *addr, int field_width, */ static char *pointer(const char *fmt, char *buf, char *end, void *ptr, int field_...
8fd2d2d5aaf086cfa3b2e2e58cab96b7afdc9e51
Analyze and fix the following issue in the Linux kernel code: cpumask: fix compile error when CONFIG_NR_CPUS is not defined
Problem Details: CONFIG_NR_CPUS will be defined for all arch's whether SMP or not, but it may not have made it into all arches yet. Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 2aef96f20b30..719ee5c1c8d9 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -133,7 +133,7 @@ print_cpus_func(present); */ static ssize_t print_cpus_kernel_max(struct sysdev_class *class, char *buf) { - int n = snprintf(buf, PAGE_SIZE-2, "...
6ca09dfc9f180d038dcef93c167a833f43a8246f
Analyze and fix the following issue in the Linux kernel code: sched: put back some stack hog changes that were undone in kernel/sched.c
Problem Details: Impact: prevents panic from stack overflow on numa-capable machines. Some of the "removal of stack hogs" changes in kernel/sched.c by using node_to_cpumask_ptr were undone by the early cpumask API updates, and causes a panic due to stack overflow. This patch undoes those changes by using cpumask_of_n...
```diff diff --git a/kernel/sched.c b/kernel/sched.c index 27ba1d642f0f..dd862d70e715 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -3715,7 +3715,7 @@ redo: * don't kick the migration_thread, if the curr * task on busiest cpu can't be moved to this_cpu */ - if (!cpu_isset(this_cpu, busiest->curr->cpu...
6bdf197b04b3ae7c85785bc5a9576f1bcb0ac7c0
Analyze and fix the following issue in the Linux kernel code: ia64: cpumask fix for is_affinity_mask_valid()
Problem Details: Impact: build fix on ia64 ia64's default_affinity_write() still had old cpumask_t usage: /home/mingo/tip/kernel/irq/proc.c: In function `default_affinity_write': /home/mingo/tip/kernel/irq/proc.c:114: error: incompatible type for argument 1 of `is_affinity_mask_valid' make[3]: *** [kernel/irq/proc...
```diff diff --git a/arch/ia64/include/asm/irq.h b/arch/ia64/include/asm/irq.h index 3627116fb0e2..36429a532630 100644 --- a/arch/ia64/include/asm/irq.h +++ b/arch/ia64/include/asm/irq.h @@ -27,7 +27,7 @@ irq_canonicalize (int irq) } extern void set_irq_affinity_info (unsigned int irq, int dest, int redir); -bool i...
263ec6457bb23d57b575ede18ff6c3d11e0b4e96
Analyze and fix the following issue in the Linux kernel code: cpumask: convert RCU implementations, fix
Problem Details: Impact: cleanup This warning: kernel/rcuclassic.c: In function ‘rcu_start_batch’: kernel/rcuclassic.c:397: warning: passing argument 1 of ‘cpumask_andnot’ from incompatible pointer type triggers because one usage site of rcp->cpumask was not converted to to_cpumask(rcp->cpumask). There's no ill ef...
```diff diff --git a/kernel/rcuclassic.c b/kernel/rcuclassic.c index 6ec495f60ead..490934fc7ac3 100644 --- a/kernel/rcuclassic.c +++ b/kernel/rcuclassic.c @@ -394,7 +394,8 @@ static void rcu_start_batch(struct rcu_ctrlblk *rcp) * unnecessarily. */ smp_mb(); - cpumask_andnot(&rcp->cpumask, cpu_online_mask, n...
0e93dd883537e628b809a2120854cd591c8935f1
Analyze and fix the following issue in the Linux kernel code: AMD IOMMU: prealloc_protection_domains should be static
Problem Details: Impact: cleanup, reduce kernel size a bit, avoid sparse warning Fixes sparse warning: arch/x86/kernel/amd_iommu.c:1299:6: warning: symbol 'prealloc_protection_domains' was not declared. Should it be static? Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Signed-off-by: Joerg Roedel ...
```diff diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 0c504b207bf9..881c68ffdf2e 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c @@ -1622,7 +1622,7 @@ static int amd_iommu_dma_supported(struct device *dev, u64 mask) * we don't need to preallocate the protectio...
7398ca79d227f7cd7f2ce23f08624e30081dcb4e
Analyze and fix the following issue in the Linux kernel code: kvm/iommu: fix compile warning
Problem Details: This fixes a compile warning about a variable thats maybe used uninitialized in the function. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
```diff diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c index d0bebaa5bf0a..e9693a29d00e 100644 --- a/virt/kvm/iommu.c +++ b/virt/kvm/iommu.c @@ -71,7 +71,7 @@ unmap_pages: static int kvm_iommu_map_memslots(struct kvm *kvm) { - int i, r; + int i, r = 0; down_read(&kvm->slots_lock); for (i = 0; i < kvm->nmems...
0087d9fb3f29f59e8d42c8b058376d80e5adde4c
Analyze and fix the following issue in the Linux kernel code: ext4: Fix s_dirty_blocks_counter if block allocation failed with nodelalloc
Problem Details: With nodelalloc option we need to update the dirty block counter on block allocation failure. This is needed because we increment the dirty block counter early in the block allocation phase. Without the patch s_dirty_blocks_counter goes wrong so that filesystem's free blocks decreases incorrectly. Tes...
```diff diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index fd2294de404c..05d9f81956c6 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -4541,7 +4541,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle, } if (ar->len == 0) { *errp = -EDQUOT; - return 0; + goto out3; } inquota = ar->len; @...
393418676a7602e1d7d3f6e560159c65c8cbd50e
Analyze and fix the following issue in the Linux kernel code: ext4: Fix the race between read_inode_bitmap() and ext4_new_inode()
Problem Details: We need to make sure we update the inode bitmap and clear EXT4_BG_INODE_UNINIT flag with sb_bgl_lock held, since ext4_read_inode_bitmap() looks at EXT4_BG_INODE_UNINIT to decide whether to initialize the inode bitmap each time it is called. (introduced by commit c806e68f.) ext4_read_inode_bitmap does:...
```diff diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index b47427a21f1c..d4e544f30be2 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -572,6 +572,79 @@ static int find_group_other(struct super_block *sb, struct inode *parent, return -1; } +/* + * claim the inode from the inode bitmap. If the group + * ...
560671a0d3c9ad2d647fa6d09375a262e1f19c4f
Analyze and fix the following issue in the Linux kernel code: ext4: Use high 16 bits of the block group descriptor's free counts fields
Problem Details: Rename the lower bits with suffix _lo and add helper to access the values. Also rename bg_itable_unused_hi to bg_pad as in e2fsprogs. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
```diff diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 404d81cc9157..902bf66c8dfb 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c @@ -102,9 +102,9 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh, if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) { ext4_error(...
e8134b27e351e813414da3b95aa8eac6d3908088
Analyze and fix the following issue in the Linux kernel code: ext4: Fix race between read_block_bitmap() and mark_diskspace_used()
Problem Details: We need to make sure we update the block bitmap and clear EXT4_BG_BLOCK_UNINIT flag with sb_bgl_lock held, since ext4_read_block_bitmap() looks at EXT4_BG_BLOCK_UNINIT to decide whether to initialize the block bitmap each time it is called (introduced by commit c806e68f), and this can race with block a...
```diff diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index cda69632eea3..d559a03f3eb2 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -1070,7 +1070,10 @@ static void mb_clear_bits(spinlock_t *lock, void *bm, int cur, int len) cur += 32; continue; } - mb_clear_bit_atomic(lock, cur, bm); + if...
5d1b1b3f492f8696ea18950a454a141381b0f926
Analyze and fix the following issue in the Linux kernel code: ext4: fix BUG when calling ext4_error with locked block group
Problem Details: The mballoc code likes to call ext4_error while it is holding locked block groups. This can causes a scheduling in atomic context BUG. We can't just unlock the block group and relock it after/if ext4_error returns since that might result in race conditions in the case where the filesystem is set to c...
```diff diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 8152b5603f0a..f0b1db6acf85 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1126,6 +1126,9 @@ extern void ext4_abort(struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4))); extern void ext4_warning(struct super_blo...
cdc7b83726297b43deed0455d8732163cc59802a
Analyze and fix the following issue in the Linux kernel code: intel-iommu: fix bit shift at DOMAIN_FLAG_P2P_MULTIPLE_DEVICES
Problem Details: Signed-off-by: Mike Day <ncmike@ncultra.org> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
```diff diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index ecb5fd3b71f7..235fb7a5a8a5 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c @@ -205,7 +205,7 @@ static inline bool dma_pte_present(struct dma_pte *pte) } /* devices under the same p2p bridge are owned in one domai...
2e824f79240476d57a8589f46232cabf151efe90
Analyze and fix the following issue in the Linux kernel code: VT-d: fix segment number being ignored when searching DRHD
Problem Details: On platforms with multiple PCI segments, any of the segments can have a DRHD with INCLUDE_PCI_ALL flag. So need to check the DRHD's segment number against the PCI device's when searching its DRHD. Signed-off-by: Yu Zhao <yu.zhao@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Sig...
```diff diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c index 691b3adeb870..5f164ff3026e 100644 --- a/drivers/pci/dmar.c +++ b/drivers/pci/dmar.c @@ -191,26 +191,17 @@ dmar_parse_one_drhd(struct acpi_dmar_header *header) static int __init dmar_parse_dev(struct dmar_drhd_unit *dmaru) { struct acpi_dmar_hardware...
220483fec0cbc3710c828a236c9f1099d5de537a
Analyze and fix the following issue in the Linux kernel code: sparc: fix warning in userspace header traps.h
Problem Details: Fix following warning: traps.h:23: extern's make no sense in userspace Add an ifdef __KERNEL__ block that cover the extern definition and a few related things that neither is for userspace. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/arch/sparc/include/asm/traps.h b/arch/sparc/include/asm/traps.h index bebdbf8f43a8..4becd66e04f2 100644 --- a/arch/sparc/include/asm/traps.h +++ b/arch/sparc/include/asm/traps.h @@ -10,7 +10,7 @@ #define NUM_SPARC_TRAPS 255 #ifndef __ASSEMBLY__ - +#ifdef __KERNEL__ /* This is for V8 compliant...
fffeeb413704b742dd1d08a3b5a0070a72ab52e1
Analyze and fix the following issue in the Linux kernel code: sparc: fix warnings in userspace header byteorder.h
Problem Details: Fix following warnings in byteorder.h: byteorder.h:4: include of <linux/types.h> is preferred over <asm/types.h> byteorder.h:9: leaks CONFIG_SPARC32 to userspace where it is not valid byteorder.h:13: leaks CONFIG_SPARC64 to userspace where it is not valid byteorder.h:14: found __[us]{8,16,32,64} type ...
```diff diff --git a/arch/sparc/include/asm/byteorder.h b/arch/sparc/include/asm/byteorder.h index 5a70f137f1f7..738414b26558 100644 --- a/arch/sparc/include/asm/byteorder.h +++ b/arch/sparc/include/asm/byteorder.h @@ -1,16 +1,12 @@ #ifndef _SPARC_BYTEORDER_H #define _SPARC_BYTEORDER_H -#include <asm/types.h> +#inc...
2ef4c01e180902a0197f959f84d4ae1d8eb18888
Analyze and fix the following issue in the Linux kernel code: sparc: fix warning in userspace header jsflash.h
Problem Details: Fix following warnings in jsflash.h: jsflash.h:11: include of <linux/types.h> is preferred over <asm/types.h> jsflash.h:24: found __[us]{8,16,32,64} type without #include <linux/types.h> Fixed by changing the include to <linux/types.h> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Da...
```diff diff --git a/arch/sparc/include/asm/jsflash.h b/arch/sparc/include/asm/jsflash.h index 3457f29bd73b..0717d9e39d2d 100644 --- a/arch/sparc/include/asm/jsflash.h +++ b/arch/sparc/include/asm/jsflash.h @@ -8,7 +8,7 @@ #define _SPARC_JSFLASH_H #ifndef _SPARC_TYPES_H -#include <asm/types.h> +#include <linux/type...
4d7b92ad572b4bd4d92fc80911641bb6cba3b99c
Analyze and fix the following issue in the Linux kernel code: sparc: add '32' suffix to reg_window, sigcontext, __siginfo_t
Problem Details: Renaming a few types to contain a 32 suffix makes the type names compatible with sparc64 and thus makes sharing between the two a lot easier. Note: None of these definitions are expected part of the stable ABI towards userspace. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. M...
```diff diff --git a/arch/sparc/include/asm/processor_32.h b/arch/sparc/include/asm/processor_32.h index 2ae67a2e7f3a..09521c6a5edb 100644 --- a/arch/sparc/include/asm/processor_32.h +++ b/arch/sparc/include/asm/processor_32.h @@ -99,7 +99,7 @@ static inline void start_thread(struct pt_regs * regs, unsigned long pc, ...
55d646feee9c0ced63f4189aca4ba7c9508b75f9
Analyze and fix the following issue in the Linux kernel code: sparc64: prepare signal_64 for unification
Problem Details: o add a sparc32 only definition o fix a few style issues (white space errors etc). o include compiler.h (for __user) Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/arch/sparc/include/asm/signal_64.h b/arch/sparc/include/asm/signal_64.h index ab1509a101c5..41535e77b255 100644 --- a/arch/sparc/include/asm/signal_64.h +++ b/arch/sparc/include/asm/signal_64.h @@ -1,7 +1,8 @@ -#ifndef _ASMSPARC64_SIGNAL_H -#define _ASMSPARC64_SIGNAL_H +#ifndef __SPARC_SIGNAL_H +#d...
37dd3cb4153084ff693e738b7ee087990d351e5e
Analyze and fix the following issue in the Linux kernel code: x86: remove debug printks (io_apic.c)
Problem Details: Impact: reduce printk noise The message "alloc irq_2_pin on cpu 0 node 0" is printed way too often. % dmesg|grep irq_2_pin|wc -l 20 Get rid of the debug printks. Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c index 69911722b9d3..45073520407f 100644 --- a/arch/x86/kernel/io_apic.c +++ b/arch/x86/kernel/io_apic.c @@ -129,7 +129,6 @@ static struct irq_pin_list *get_one_free_irq_2_pin(int cpu) node = cpu_to_node(cpu); pin = kzalloc_node(sizeof(*pin...
90621c40cc4ab7b0a414311ce37e7cc7173403b6
Analyze and fix the following issue in the Linux kernel code: futex: catch certain assymetric (get|put)_futex_key calls
Problem Details: Impact: add debug check Following up on my previous key reference accounting patches, this patch will catch puts on keys that haven't been "got". This won't catch nested get/put mismatches though. Build and boot tested, with minimal desktop activity and a run of the open_posix_testsuite in LTP for t...
```diff diff --git a/kernel/futex.c b/kernel/futex.c index c5ac55cc0c16..206d4c906885 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -170,8 +170,11 @@ static void get_futex_key_refs(union futex_key *key) */ static void drop_futex_key_refs(union futex_key *key) { - if (!key->both.ptr) + if (!key->both.ptr) { + ...
7826005e5a53645d7aab7c13eda76126eadebf0b
Analyze and fix the following issue in the Linux kernel code: kconfig: improve error messages for bad source statements
Problem Details: We now say where we detect the second source of a file, and where we detect a recursively source of the same file. This makes it easier to fix such errors. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Roman Zippel <zippel@linux-m68k.org>
```diff diff --git a/scripts/kconfig/lex.zconf.c_shipped b/scripts/kconfig/lex.zconf.c_shipped index 7342ce0a7780..dc3e81807d13 100644 --- a/scripts/kconfig/lex.zconf.c_shipped +++ b/scripts/kconfig/lex.zconf.c_shipped @@ -2370,11 +2370,14 @@ void zconf_nextfile(const char *name) current_buf = buf; if (file->flag...
cfb2a494bb7dca9cf8d1632fbed14b34db051980
Analyze and fix the following issue in the Linux kernel code: m68k: fix recursive dependency in Kconfig
Problem Details: We had a recursive dependency between MMU_MOTOROLA and MMU_SUN3 Fix it by dropping the unused dependencies on MMU_MOTOROLA. MMU_MOTOROLA is set to y only using select so any dependencies are anyway ignored. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Acked-by: Geert Uytterhoeven <geert@linux-m68k....
```diff diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 836fb66f080d..c825bde17cb3 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -280,7 +280,6 @@ config M68060 config MMU_MOTOROLA bool - depends on MMU && !MMU_SUN3 config MMU_SUN3 bool ```
f4c82548d4fa86fb3606f6ee219b070b88592a1e
Analyze and fix the following issue in the Linux kernel code: V4L/DVB (10168): sms1xxx: fix inverted gpio for lna control on tiger r2
Problem Details: The GPIO logic for LNA control on the Tiger r2 devices was inverted. This patch corrects the problem. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/dvb/siano/sms-cards.c b/drivers/media/dvb/siano/sms-cards.c index 5a9882ffeb42..4307e4e8aa34 100644 --- a/drivers/media/dvb/siano/sms-cards.c +++ b/drivers/media/dvb/siano/sms-cards.c @@ -120,7 +120,7 @@ static struct sms_board sms_boards[] = { .name = "Hauppauge WinTV MiniCard", ...
0b82c5d6748a15758875f78ac772c6d48ebead2a
Analyze and fix the following issue in the Linux kernel code: V4L/DVB (10162): tuner-simple: Fix tuner type set message
Problem Details: Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/common/tuners/tuner-simple.c b/drivers/media/common/tuners/tuner-simple.c index fb3f3b3adaba..1a21191566f5 100644 --- a/drivers/media/common/tuners/tuner-simple.c +++ b/drivers/media/common/tuners/tuner-simple.c @@ -1059,7 +1059,12 @@ struct dvb_frontend *simple_tuner_attach(struct dv...
4a87d7c4f259efa89ae6627c49e403eef51a3058
Analyze and fix the following issue in the Linux kernel code: V4L/DVB (10161): saa7134: fix autodetection for AVer TV GO 007 FM Plus
Problem Details: This patch fixes autodetection for Avermedia AVerTV GO 007 FM Plus (M15C) (PCI ID 1461:f31d). Signed-off-by: Pham Thanh Nam <phamthanhnam.ptn@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index e9c471cb04bb..e2febcd6e529 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c @@ -5732,6 +5732,13 @@ struct pci_device_id saa7134_pci_tbl[] = { ...
b0c4be8cffb3f466759ddf621a74a10093537521
Analyze and fix the following issue in the Linux kernel code: V4L/DVB (10154): saa7134: fix a merge conflict on Behold H6 board
Problem Details: Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index a25a740b5586..0776ecf56d27 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c @@ -1366,11 +1366,11 @@ static int dvb_init(struct saa7134_dev *dev) goto...
899a6f67b90206c330bd93c7c8f3f8bb8b80397a
Analyze and fix the following issue in the Linux kernel code: V4L/DVB (10151): Fix I2C bridge error in zl10353
Problem Details: Fix I2C bridge error in zl10353 if no tunner attached to internal I2C bus of zl10353 chip. When set enable bridge from internal I2C bus to the main I2C bus (saa7134) the main I2C bus stopped very hardly. No any communication. In our next board we solder additional resistors to internal I2C bus. Signe...
```diff diff --git a/drivers/media/dvb/frontends/zl10353.c b/drivers/media/dvb/frontends/zl10353.c index 5506f80e180e..170720b02815 100644 --- a/drivers/media/dvb/frontends/zl10353.c +++ b/drivers/media/dvb/frontends/zl10353.c @@ -587,8 +587,15 @@ static int zl10353_init(struct dvb_frontend *fe) static int zl10353_i...
9ed55375919bc30c448c6dd5107e8d593f96856f
Analyze and fix the following issue in the Linux kernel code: V4L/DVB (10144): cx24116: build fix
Problem Details: Add missed MODULE check to eliminate inapropriate declaration being choosed which causes a build error. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/dvb/frontends/cx24116.h b/drivers/media/dvb/frontends/cx24116.h index 4cb3ddd6c626..b1b76b47a14c 100644 --- a/drivers/media/dvb/frontends/cx24116.h +++ b/drivers/media/dvb/frontends/cx24116.h @@ -37,7 +37,8 @@ struct cx24116_config { u8 mpg_clk_pos_pol:0x02; }; -#if defined(CONFI...
da1b5c95e49bb564ae8c61ed135d34ed09acbb66
Analyze and fix the following issue in the Linux kernel code: V4L/DVB (10140): gp8psk: fix incorrect return code (EINVAL instead of -EINVAL)
Problem Details: Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/dvb/dvb-usb/gp8psk.c b/drivers/media/dvb/dvb-usb/gp8psk.c index c1da962cc886..3dd6843864ed 100644 --- a/drivers/media/dvb/dvb-usb/gp8psk.c +++ b/drivers/media/dvb/dvb-usb/gp8psk.c @@ -187,7 +187,7 @@ int gp8psk_bcm4500_reload(struct dvb_usb_device *d) /* load BCM4500 firmware */ i...
bef2a508b4276fd7897b2cb27df037d26361842c
Analyze and fix the following issue in the Linux kernel code: i8k: Add Dell Vostro systems
Problem Details: This trivial patch adds support for i8k on the new Dell Vostro models. I tested it on my Vostro 1400, and it works. It does print a warning when loading the module: i8k: unable to get SMM BIOS version But I couldn't figure out how to fix that. The module seems to work fine, anyway... Signed-off-by:...
```diff diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c index 099fc89a5bdd..fc8cf7ac7f2b 100644 --- a/drivers/char/i8k.c +++ b/drivers/char/i8k.c @@ -492,7 +492,14 @@ static struct dmi_system_id __initdata i8k_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Precision"), }, }, - { } + { + .ident = "Dell Vost...
e8e32326279cba3d049b4325111f76618953195c
Analyze and fix the following issue in the Linux kernel code: Fix compiler warning in arch/x86/mm/init_32.c
Problem Details: Signed-off-by: Ingo Brueckl <ib@wupperonline.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 8655b5bb0963..f99a6c6c432e 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c @@ -435,8 +435,12 @@ static void __init set_highmem_pages_init(void) #endif /* !CONFIG_NUMA */ #else -# define permanent_kmaps_init(pgd_base) do { } whi...
103ceffb9501531f6931df6aebc11a05189201f0
Analyze and fix the following issue in the Linux kernel code: x86: mpparse.c fix style problems
Problem Details: Impact: cleanup, fix style problems, more readable Fixes style problems: WARNING: Use #include <linux/smp.h> instead of <asm/smp.h> WARNING: Use #include <linux/acpi.h> instead of <asm/acpi.h> WARNING: suspect code indent for conditional statements (8, 17) WARNING: space prohibited between functi...
```diff diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index 45e3b69808ba..c5c5b8df1dbc 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c @@ -16,14 +16,14 @@ #include <linux/bitops.h> #include <linux/acpi.h> #include <linux/module.h> +#include <linux/smp.h> +#include <linux/a...
58eb17f155704062d76729d1fb7e23d3559ca86a
Analyze and fix the following issue in the Linux kernel code: hso modem detect fix patch against Alan Cox'es tty tree
Problem Details: Fixed incorrect check for the modem port, this prevents crashes caused by issueing a tiocmget_submit_urb on endpoints which don't exist for non modem devices. Signed-off-by: Denis Joseph Barrow <D.Barow@option.com> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux...
```diff diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index d974d970e5fd..148af34837f0 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -2663,7 +2663,7 @@ static struct hso_device *hso_create_bulk_serial_device( serial->parent = hso_dev; hso_dev->port_data.dev_serial = serial; - if (...
ad36b88e2d22e9ef42797581d3ecea9feadd9488
Analyze and fix the following issue in the Linux kernel code: tty: Fix an ircomm warning and note another bug
Problem Details: Roel Kluin noted that line is unsigned so one test is unneccessary. Also add a warning for another flaw I noticed while making this change. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c index e4e2caeb9d82..086d5ef098fd 100644 --- a/net/irda/ircomm/ircomm_tty.c +++ b/net/irda/ircomm/ircomm_tty.c @@ -371,9 +371,8 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) IRDA_DEBUG(2, "%s()\n", __func__ ); ...
c847d47cb7b2fa78b17c9e17ed3fbd010ee3d3ca
Analyze and fix the following issue in the Linux kernel code: drivers/char/cyclades.c: cy_pci_probe: fix error path
Problem Details: We forgot to release resources in one case. Addresses http://bugzilla.kernel.org/show_bug.cgi?id=12137 Reported-by: Florian Lohoff <flo@rfc822.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundati...
```diff diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index 5e5b1dc1a0a7..6a59f72a9c21 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c @@ -5010,7 +5010,7 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev, if (nchan == 0) { dev_err(&pdev->dev, "Cyclom-Y PCI host card wi...
7d6a07d123b62bf4fa71867420c23da3ca36c995
Analyze and fix the following issue in the Linux kernel code: 8250: Serial driver changes to support future Cavium OCTEON serial patches.
Problem Details: In order to use Cavium OCTEON specific serial i/o drivers, we first patch the 8250 driver to use replaceable I/O functions. Compatible I/O functions are added for existing iotypeS. An added benefit of this change is that it makes it easy to factor some of the existing special cases out to board/SOC s...
```diff diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 8e28750a4058..849af9d21feb 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -303,16 +303,16 @@ static const u8 au_io_out_map[] = { }; /* sane hardware needs no mapping */ -static inline int map_8250_in_reg(struct uart_8250_por...
bc3256288b8ff9787623805e53cf7c6d5a2b4591
Analyze and fix the following issue in the Linux kernel code: fix for tty-serial-move-port
Problem Details: Hi Alan next-20081204 crashes with the following message: BUG: unable to handle kernel paging request at ffff88007d320248 IP: [<ffffffff803de934>] uart_remove_one_port+0xef/0x111 kfree(info); 393: 49 8d 7d 10 lea 0x10(%r13),%rdi 397: e8 00 00 00 00...
```diff diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index daeba1c52c8e..9425ed69e0f7 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -2530,10 +2530,8 @@ int uart_remove_one_port(struct uart_driver *drv, struct uart_port *port) /* * Kill the tasklet, and ...
ac9720c37e8795317e8be3adad63cb0d5522a640
Analyze and fix the following issue in the Linux kernel code: tty: Fix the HSO termios handling a bit
Problem Details: Init the tty structure once Don't set ->low_latency twice in a row Don't force bits we should be leaving to the user Don't allocate termios arrays as these are in fact allocated by the tty layer for you and just overwrite the ones allocated in the driver Signed-off-by: Alan Cox <alan@redhat.com> Signe...
```diff diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index d345a6eec4ca..7373fb6b3f88 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -362,8 +362,6 @@ static struct tty_driver *tty_drv; static struct hso_device *serial_table[HSO_SERIAL_TTY_MINORS]; static struct hso_device *network_tab...
ff8cb0fd6f195389aefe55d5dac9927d09a9de54
Analyze and fix the following issue in the Linux kernel code: tty: N_TTY SIGIO only works for read
Problem Details: The N_TTY ldisc layer does not send SIGIO POLL_OUTs correctly when output is possible due to flawed handling of the TTY_DO_WRITE_WAKEUP bit. It will either send no SIGIOs at all or on every tty wakeup. The fix is to set the bit when the tty driver write would block and test and clear it on write wakeu...
```diff diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index 3922a084205e..f6f0e4ec2b51 100644 --- a/drivers/char/n_tty.c +++ b/drivers/char/n_tty.c @@ -1352,10 +1352,8 @@ static void n_tty_write_wakeup(struct tty_struct *tty) /* Write out any echoed characters that are still pending */ process_echoes(tty...
eff6937a46e096eb35c16a391617b7a5e098a30c
Analyze and fix the following issue in the Linux kernel code: tty: USB tty devices can block in tcdrain when unplugged
Problem Details: The underlying problem is that the device methods don't all correctly handle disconnected status and some keep reporting bytes pending which causes tcdrain to stall. When the cable is unplugged they are definitely gone, and as this is true for all USB cables we can fix it in the core usb serial code. ...
```diff diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index aafa684a900f..8d5189096470 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -339,6 +339,10 @@ static int serial_chars_in_buffer(struct tty_struct *tty) dbg("%s = port %d", __func__, port->...
c9b3976e3fec266be25c5001a70aa0a890b6c476
Analyze and fix the following issue in the Linux kernel code: tty: Fix PPP hang under load
Problem Details: Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/char/tty_ldisc.c b/drivers/char/tty_ldisc.c index f307f135cbfb..7a84b406a952 100644 --- a/drivers/char/tty_ldisc.c +++ b/drivers/char/tty_ldisc.c @@ -316,8 +316,7 @@ struct tty_ldisc *tty_ldisc_ref_wait(struct tty_struct *tty) { /* wait_event is a macro */ wait_event(tty_ldisc_wait, tt...
8c056e5b148498192832678cf2957760945e8c71
Analyze and fix the following issue in the Linux kernel code: devpts: fix unused function warning
Problem Details: fs/devpts/inode.c:324: warning: 'compare_init_pts_sb' defined but not used Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index b02c24313d5c..3f309f181de8 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -320,6 +320,7 @@ fail: return -ENOMEM; } +#ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES static int compare_init_pts_sb(struct super_block *s, void *p) { if (devpts_mnt...
4bd43f2c31848d751f63e8753cd2788d48fb5f30
Analyze and fix the following issue in the Linux kernel code: tty: Fix close races in USB serial
Problem Details: USB serial has always had races where the tty port usage count can hit zero during a receive event. The internal locking is a mutex so we can't use that in the IRQ handlers. With krefs we can tackle this differently but we still need to be careful. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off...
```diff diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 794b5ffe4397..aafa684a900f 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -269,15 +269,19 @@ static void serial_close(struct tty_struct *tty, struct file *filp) return; } - --port->...
acc71bbad33478973dbed68ebbc2d76dac9a51bd
Analyze and fix the following issue in the Linux kernel code: n_tty: Fix hanfling of buffer full corner cases
Problem Details: Fix the handling of input characters when the tty buffer is full or nearly full. This includes tests that are done in n_tty_receive_char() and handling of PARMRK. Problems with the buffer-full tests done in receive_char() caused characters to be lost at times when the buffer(s) filled. Also, these f...
```diff diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index 30b0426b3788..4b1e96b65ab0 100644 --- a/drivers/char/n_tty.c +++ b/drivers/char/n_tty.c @@ -1107,6 +1107,7 @@ static inline void n_tty_receive_parity_error(struct tty_struct *tty, static inline void n_tty_receive_char(struct tty_struct *tty, unsign...
a59c0d6f14315a3f300f6f3786137213727e4c47
Analyze and fix the following issue in the Linux kernel code: n_tty: Fix handling of control characters and continuations
Problem Details: Fix process_output_block to detect continuation characters correctly and to handle control characters even when O_OLCUC is enabled. Make similar change to do_output_char(). Signed-off-by: Joe Peterson <joe@skyrush.com> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@...
```diff diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index a223823544bf..30b0426b3788 100644 --- a/drivers/char/n_tty.c +++ b/drivers/char/n_tty.c @@ -351,10 +351,12 @@ static int do_output_char(unsigned char c, struct tty_struct *tty, int space) tty->column--; break; default: - if (O_OLCUC(tty)) ...
a47d545f5782cbde871b50bdf4a83379ed2da222
Analyze and fix the following issue in the Linux kernel code: tty: Fix sparse static warning for tty_driver_lookup_tty
Problem Details: Fixed sparse warning: drivers/char/tty_io.c:1216:19: warning: symbol 'tty_driver_lookup_tty' was not declared. Should it be static? Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index d8d240c8a25a..2a15af65dd11 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -1211,7 +1211,7 @@ static void tty_line_name(struct tty_driver *driver, int index, char *p) * be held until the 'fast-open' is also done. Will change on...
d95186d1f455b4b901121ba69d0680800fb4b57b
Analyze and fix the following issue in the Linux kernel code: sierra: Fix formatting
Problem Details: Andrew Morton wrote: in drivers/usb/serial/sierra.c: } else { if (urb->actual_length) { + tty = tty_port_tty_get(&port->port); tty_buffer_request_room(tty, urb->actual_length); it's missing a tab. Signed-off-by: Alan Cox <alan@redhat.com...
```diff diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index 0f2b67244af6..d9bf9a5c20ec 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c @@ -442,7 +442,7 @@ static void sierra_indat_callback(struct urb *urb) " endpoint %02x.", __func__, status, endpoint); } els...
2a1b2dc0c83bbfc24d72cafd5e69810a149b44e4
Analyze and fix the following issue in the Linux kernel code: Enable multiple instances of devpts
Problem Details: To support containers, allow multiple instances of devpts filesystem, such that indices of ptys allocated in one instance are independent of ptys allocated in other instances of devpts. But to preserve backward compatibility, enable this support for multiple instances only if: - CONFIG_DEVPTS_MULTIP...
```diff diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index 2d0eb2cf99e6..b4a89fa21673 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -48,10 +48,11 @@ struct pts_mount_opts { gid_t gid; umode_t mode; umode_t ptmxmode; + int newinstance; }; enum { - Opt_uid, Opt_gid, Opt_mode, Opt_ptmxmode, +...
1f8f1e296583f9f832c2fe7b5a219675b74bf43e
Analyze and fix the following issue in the Linux kernel code: Define mknod_ptmx()
Problem Details: /dev/ptmx is closely tied to the devpts filesystem. An open of /dev/ptmx, allocates the next pty index and the associated device shows up in the devpts fs as /dev/pts/n. Wih multiple instancs of devpts filesystem, during an open of /dev/ptmx we would be unable to determine which instance of the devpts...
```diff diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index 00530e82673e..8ee9dc2f9e48 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -27,6 +27,13 @@ #define DEVPTS_SUPER_MAGIC 0x1cd1 #define DEVPTS_DEFAULT_MODE 0600 +/* + * ptmx is a new node in /dev/pts and will be unused in legacy (single- + * in...