id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
eab1eef9911c36966b5d5934e6970581b3316013
Analyze and fix the following issue in the Linux kernel code: mm: thp: fix the update_mmu_cache() last argument passing in mm/huge_memory.c
Problem Details: The update_mmu_cache() takes a pointer (to pte_t by default) as the last argument but the huge_memory.c passes a pmd_t value. The patch changes the argument to the pmd_t * pointer. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Steve Capper <steve.capper@arm.com> Signed-off-b...
```diff diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 7153e0d18670..0e7740923fb9 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -889,7 +889,7 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, entry = pmd_mkyoung(orig_pmd); entry = maybe_pmd_mkwrite(pmd_mkdirty(entry), ...
2d28a2275c21d04290cfba1555c89a806d2b7706
Analyze and fix the following issue in the Linux kernel code: mm: thp: fix the pmd_clear() arguments in pmdp_get_and_clear()
Problem Details: The CONFIG_TRANSPARENT_HUGEPAGE implementation of pmdp_get_and_clear() calls pmd_clear() with 3 arguments instead of 1. This happens only for !__HAVE_ARCH_PMDP_GET_AND_CLEAR which doesn't seem to happen because x86 defines this and it uses pmd_update. [mhocko@suse.cz: changelog addition] Signed-off-b...
```diff diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index ebdd74fb8d6a..b36ce40bd1c6 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -87,7 +87,7 @@ static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm, pmd_t *pmdp) { pmd_t pmd = *pmd...
74c08f982674cfd5dfeb2702d631db9bcdabf788
Analyze and fix the following issue in the Linux kernel code: memory-hotplug: don't replace lowmem pages with highmem
Problem Details: The changelog for commit 6a6dccba2fdc ("mm: cma: don't replace lowmem pages with highmem") mentioned that lowmem pages can be replaced by highmem pages during CMA migration. 6a6dccba2fdc fixed that issue. Quote from that changelog: : The filesystem layer expects pages in the block device's mapping...
```diff diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index b35016156c19..f9ac0955e10a 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -756,13 +756,6 @@ static unsigned long scan_lru_pages(unsigned long start, unsigned long end) return 0; } -static struct page * -hotremove_migrate_alloc(stru...
723a0644a7255f532575fd43245f9ef976491328
Analyze and fix the following issue in the Linux kernel code: mm/page_alloc: refactor out __alloc_contig_migrate_alloc()
Problem Details: __alloc_contig_migrate_alloc() can be used by memory-hotplug so refactor it out (move + rename as a common name) into page_isolation.c. [akpm@linux-foundation.org: checkpatch fixes] Signed-off-by: Minchan Kim <minchan@kernel.org> Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Reviewed-by: Yasu...
```diff diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h index fca8c0a5c188..76a9539cfd3f 100644 --- a/include/linux/page-isolation.h +++ b/include/linux/page-isolation.h @@ -41,6 +41,7 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn); */ int set_migratetype_isol...
435b405c06119d93333738172b8060b0ed12af41
Analyze and fix the following issue in the Linux kernel code: memory-hotplug: fix pages missed by race rather than failing
Problem Details: If race between allocation and isolation in memory-hotplug offline happens, some pages could be in MIGRATE_MOVABLE of free_list although the pageblock's migratetype of the page is MIGRATE_ISOLATE. The race could be detected by get_freepage_migratetype in __test_page_isolated_in_pageblock. If it is de...
```diff diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h index 105077aa7685..fca8c0a5c188 100644 --- a/include/linux/page-isolation.h +++ b/include/linux/page-isolation.h @@ -6,6 +6,10 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count); void set_pageblock_migratety...
41d575ad4a511b71a4a41c8313004212f5c229b1
Analyze and fix the following issue in the Linux kernel code: memory-hotplug: bug fix race between isolation and allocation
Problem Details: Like below, memory-hotplug makes race between page-isolation and page-allocation so it can hit BUG_ON in __offline_isolated_pages. CPU A CPU B start_isolate_page_range set_migratetype_isolate spin_lock_irqsave(zone->lock) free_hot_cold_page(Page A) /* without zone->lock */ migratety...
```diff diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 9c03dca8c2ad..6744235d2d0e 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -200,8 +200,11 @@ __test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn) continue; } page = pfn_to_page(pfn); - if (PageBuddy(page...
d95ea5d18e699515468368415c93ed49b1a3221b
Analyze and fix the following issue in the Linux kernel code: cma: fix watermark checking
Problem Details: * Add ALLOC_CMA alloc flag and pass it to [__]zone_watermark_ok() (from Minchan Kim). * During watermark check decrease available free pages number by free CMA pages number if necessary (unmovable allocations cannot use pages from CMA areas). Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierk...
```diff diff --git a/mm/compaction.c b/mm/compaction.c index 0fbc6b73a522..1f61bcbd6262 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -934,6 +934,7 @@ unsigned long try_to_compact_pages(struct zonelist *zonelist, struct zoneref *z; struct zone *zone; int rc = COMPACT_SKIPPED; + int alloc_flags = 0; /*...
2139cbe627b8910ded55148f87ee10f7485408ed
Analyze and fix the following issue in the Linux kernel code: cma: fix counting of isolated pages
Problem Details: Isolated free pages shouldn't be accounted to NR_FREE_PAGES counter. Fix it by properly decreasing/increasing NR_FREE_PAGES counter in set_migratetype_isolate()/unset_migratetype_isolate() and removing counter adjustment for isolated pages from free_one_page() and split_free_page(). Signed-off-by: Ba...
```diff diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 3f18a14effb8..d259cc2b69c1 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -691,7 +691,8 @@ static void free_one_page(struct zone *zone, struct page *page, int order, zone->pages_scanned = 0; __free_one_page(page, zone, order, migratetype); - __mo...
770c8aaaf6f04a87e6765f24d497132de9152a46
Analyze and fix the following issue in the Linux kernel code: mm: fix tracing in free_pcppages_bulk()
Problem Details: page->private gets re-used in __free_one_page() to store page order (so trace_mm_page_pcpu_drain() may print order instead of migratetype) thus migratetype value must be cached locally. Fixes regression introduced in commit a7016235a61d ("mm: fix migratetype bug which slowed swapping"). This caused i...
```diff diff --git a/mm/page_alloc.c b/mm/page_alloc.c index cefd14e6dcf2..3f18a14effb8 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -668,12 +668,15 @@ static void free_pcppages_bulk(struct zone *zone, int count, batch_free = to_free; do { + int mt; /* migratetype of the to-be-freed page */ + pa...
02c6de8d757cb32c0829a45d81c3dfcbcafd998b
Analyze and fix the following issue in the Linux kernel code: mm: cma: discard clean pages during contiguous allocation instead of migration
Problem Details: Drop clean cache pages instead of migration during alloc_contig_range() to minimise allocation latency by reducing the amount of migration that is necessary. It's useful for CMA because latency of migration is more important than evicting the background process's working set. In addition, as pages ar...
```diff diff --git a/include/linux/rmap.h b/include/linux/rmap.h index b2cce644ffc7..bfe1f4780644 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -71,6 +71,17 @@ struct anon_vma_chain { #endif }; +enum ttu_flags { + TTU_UNMAP = 0, /* unmap mode */ + TTU_MIGRATION = 1, /* migration mode */ + TTU_M...
28d7530928d01638678f63c3c70113540b0e6abe
Analyze and fix the following issue in the Linux kernel code: rbtree test: fix sparse warning about 64-bit constant
Problem Details: Just a small fix to make sparse happy. Signed-off-by: Michel Lespinasse <walken@google.com> Reported-by: Fengguang Wu <wfg@linux.intel.com> Acked-by: Rik van Riel <riel@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: David Woodhouse <dwmw2@infrade...
```diff diff --git a/lib/rbtree_test.c b/lib/rbtree_test.c index 19dfca9ff7d7..fd09465d82ca 100644 --- a/lib/rbtree_test.c +++ b/lib/rbtree_test.c @@ -88,7 +88,7 @@ static int rbtree_test_init(void) printk(KERN_ALERT "rbtree testing"); - prandom32_seed(&rnd, 3141592653589793238); + prandom32_seed(&rnd, 3141592653...
d6ff1273928ebf15466a85b7e1810cd00e72998b
Analyze and fix the following issue in the Linux kernel code: rbtree: adjust node color in __rb_erase_color() only when necessary
Problem Details: In __rb_erase_color(), we were always setting a node to black after exiting the main loop. And in one case, after fixing up the tree to satisfy all rbtree invariants, we were setting the current node to root just to guarantee a loop exit, at which point the root would be set to black. However this is...
```diff diff --git a/lib/rbtree.c b/lib/rbtree.c index 41cf19b2fe51..baf7c835c57c 100644 --- a/lib/rbtree.c +++ b/lib/rbtree.c @@ -259,10 +259,22 @@ static void __rb_erase_color(struct rb_node *node, struct rb_node *parent, { struct rb_node *other; - while ((!node || rb_is_black(node)) && node != root->rb_node) - ...
910a742d4ba863848c7283d69c21bfa779d3b9a8
Analyze and fix the following issue in the Linux kernel code: rbtree: performance and correctness test
Problem Details: This small module helps measure the performance of rbtree insert and erase. Additionally, we run a few correctness tests to check that the rbtrees have all desired properties: - contains the right number of nodes in the order desired, - never two consecutive red nodes on any path, - all paths to leaf...
```diff diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index b7281e4d1473..a4e5d93b0f41 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1282,6 +1282,13 @@ config LATENCYTOP source mm/Kconfig.debug source kernel/trace/Kconfig +config RBTREE_TEST + tristate "Red-Black tree test" + depends on m && DEBUG...
bf7ad8eeab995710c766df49c9c69a8592ca0216
Analyze and fix the following issue in the Linux kernel code: rbtree: move some implementation details from rbtree.h to rbtree.c
Problem Details: rbtree users must use the documented APIs to manipulate the tree structure. Low-level helpers to manipulate node colors and parenthood are not part of that API, so move them to lib/rbtree.c [dwmw2@infradead.org: fix jffs2 build issue due to renamed __rb_parent_color field] Signed-off-by: Michel Lespi...
```diff diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c index 1ea349fff68b..ae81b01e6fd7 100644 --- a/fs/jffs2/readinode.c +++ b/fs/jffs2/readinode.c @@ -394,8 +394,11 @@ static int jffs2_add_tn_to_tree(struct jffs2_sb_info *c, } /* Trivial function to remove the last node in the tree. Which by definition ...
ea5272f5c94fb2ee62f4f15a5b88eef6184cd506
Analyze and fix the following issue in the Linux kernel code: rbtree: fix incorrect rbtree node insertion in fs/proc/proc_sysctl.c
Problem Details: The recently added code to use rbtrees in sysctl did not follow the proper rbtree interface on insertion - it was calling rb_link_node() which inserts a new node into the binary tree, but missed the call to rb_insert_color() which properly balances the rbtree and establishes all expected rbtree invaria...
```diff diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index fddc50729632..a781bdf06694 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -142,6 +142,7 @@ static int insert_entry(struct ctl_table_header *head, struct ctl_table *entry) } rb_link_node(node, parent, p); + rb_insert_color(...
4c199a93a2d36b277a9fd209a0f2793f8460a215
Analyze and fix the following issue in the Linux kernel code: rbtree: empty nodes have no color
Problem Details: Empty nodes have no color. We can make use of this property to simplify the code emitted by the RB_EMPTY_NODE and RB_CLEAR_NODE macros. Also, we can get rid of the rb_init_node function which had been introduced by commit 88d19cf37952 ("timers: Add rb_init_node() to allow for stack allocated rb nodes...
```diff diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index dcd56f84db7e..fddc50729632 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -168,10 +168,8 @@ static void init_header(struct ctl_table_header *head, head->node = node; if (node) { struct ctl_table *entry; - for (entry = ta...
ca42b26ab285edc5ee3f9faa48379d258db53c35
Analyze and fix the following issue in the Linux kernel code: mm: fix potential anon_vma locking issue in mprotect()
Problem Details: Fix an anon_vma locking issue in the following situation: - vma has no anon_vma - next has an anon_vma - vma is being shrunk / next is being expanded, due to an mprotect call We need to take next's anon_vma lock to avoid races with rmap users (such as page migration) while next is being expanded. Si...
```diff diff --git a/mm/mmap.c b/mm/mmap.c index 2ba27434e843..e3c365ff1b6a 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -573,8 +573,12 @@ again: remove_next = 1 + (end > next->vm_end); */ if (vma->anon_vma && (importer || start != vma->vm_start)) { anon_vma = vma->anon_vma; + VM_BUG_ON(adjust_next && next->ano...
65b3c07b43f7f8a5cbf8923011bd4e6650e3d1dc
Analyze and fix the following issue in the Linux kernel code: thp: fix the count of THP_COLLAPSE_ALLOC
Problem Details: THP_COLLAPSE_ALLOC is double counted if NUMA is disabled since it has already been calculated in khugepaged_alloc_hugepage Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Hugh Dickins <hughd@google.com> Cc: David Rientjes <rientjes@google...
```diff diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 9b72d1270519..860ea9127851 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1874,9 +1874,9 @@ static void collapse_huge_page(struct mm_struct *mm, *hpage = ERR_PTR(-ENOMEM); return; } + count_vm_event(THP_COLLAPSE_ALLOC); #endif - count_v...
d5dc0ad928fb9e972001e552597fd0b794863f34
Analyze and fix the following issue in the Linux kernel code: mm/vmscan: fix error number for failed kthread
Problem Details: Fix the return value while failing to create the kswapd kernel thread. Also, the error message is prioritized as KERN_ERR. Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by:...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index f6fdae7a8d4c..d16bf5a53266 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3126,9 +3126,9 @@ int kswapd_run(int nid) if (IS_ERR(pgdat->kswapd)) { /* failure at boot is fatal */ BUG_ON(system_state == SYSTEM_BOOTING); - printk("Failed to start kswapd on node %...
48af0d7cb3c87fae2ff38af372821dcb0b019c9e
Analyze and fix the following issue in the Linux kernel code: mm: mmu_notifier: fix inconsistent memory between secondary MMU and host
Problem Details: There is a bug in set_pte_at_notify() which always sets the pte to the new page before releasing the old page in the secondary MMU. At this time, the process will access on the new page, but the secondary MMU still access on the old page, the memory is inconsistent between them The below scenario sho...
```diff diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index 1d1b1e13f79f..6f32b2b1f76b 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h @@ -311,14 +311,24 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) __young; \ }) +/* + * set_pte_a...
00442ad04a5eac08a98255697c510e708f6082e2
Analyze and fix the following issue in the Linux kernel code: mempolicy: fix a memory corruption by refcount imbalance in alloc_pages_vma()
Problem Details: Commit cc9a6c877661 ("cpuset: mm: reduce large amounts of memory barrier related damage v3") introduced a potential memory corruption. shmem_alloc_page() uses a pseudo vma and it has one significant unique combination, vma->vm_ops=NULL and vma->policy->flags & MPOL_F_SHARED. get_vma_policy() does NOT ...
```diff diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 1763418f1ada..3d64b369180d 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -1552,8 +1552,18 @@ struct mempolicy *get_vma_policy(struct task_struct *task, addr); if (vpol) pol = vpol; - } else if (vma->vm_policy) + } else if (vma->vm_pol...
63f74ca21f1fad36d075e063f06dcc6d39fe86b2
Analyze and fix the following issue in the Linux kernel code: mempolicy: fix refcount leak in mpol_set_shared_policy()
Problem Details: When shared_policy_replace() fails to allocate new->policy is not freed correctly by mpol_set_shared_policy(). The problem is that shared mempolicy code directly call kmem_cache_free() in multiple places where it is easy to make a mistake. This patch creates an sp_free wrapper function and uses it. T...
```diff diff --git a/mm/mempolicy.c b/mm/mempolicy.c index b2f12ecc1b34..1763418f1ada 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -2157,12 +2157,17 @@ mpol_shared_policy_lookup(struct shared_policy *sp, unsigned long idx) return pol; } +static void sp_free(struct sp_node *n) +{ + mpol_put(n->policy); + kme...
b22d127a39ddd10d93deee3d96e643657ad53a49
Analyze and fix the following issue in the Linux kernel code: mempolicy: fix a race in shared_policy_replace()
Problem Details: shared_policy_replace() use of sp_alloc() is unsafe. 1) sp_node cannot be dereferenced if sp->lock is not held and 2) another thread can modify sp_node between spin_unlock for allocating a new sp node and next spin_lock. The bug was introduced before 2.6.12-rc2. Kosaki's original patch for this prob...
```diff diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index ba7a0ff19d39..cec569325608 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h @@ -188,7 +188,7 @@ struct sp_node { struct shared_policy { struct rb_root root; - spinlock_t lock; + struct mutex mutex; }; void mp...
869833f2c5c6e4dd09a5378cfc665ffb4615e5d2
Analyze and fix the following issue in the Linux kernel code: mempolicy: remove mempolicy sharing
Problem Details: Dave Jones' system call fuzz testing tool "trinity" triggered the following bug error with slab debugging enabled ============================================================================= BUG numa_policy (Not tainted): Poison overwritten ------------------------------------------------...
```diff diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 92daa267baf2..f0728ae74672 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -607,24 +607,39 @@ check_range(struct mm_struct *mm, unsigned long start, unsigned long end, return first; } -/* Apply policy to a single VMA */ -static int policy_vma(struct vm...
8d34694c1abf29df1f3c7317936b7e3e2e308d9b
Analyze and fix the following issue in the Linux kernel code: revert "mm: mempolicy: Let vma_merge and vma_split handle vma->vm_policy linkages"
Problem Details: Commit 05f144a0d5c2 ("mm: mempolicy: Let vma_merge and vma_split handle vma->vm_policy linkages") removed vma->vm_policy updates code but it is the purpose of mbind_range(). Now, mbind_range() is virtually a no-op and while it does not allow memory corruption it is not the right fix. This patch is a r...
```diff diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 4ada3be6e252..92daa267baf2 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -607,6 +607,27 @@ check_range(struct mm_struct *mm, unsigned long start, unsigned long end, return first; } +/* Apply policy to a single VMA */ +static int policy_vma(struct vm_...
83fde0f22872aa8c1d46f775cc7bdfa864499e65
Analyze and fix the following issue in the Linux kernel code: mm: vmscan: scale number of pages reclaimed by reclaim/compaction based on failures
Problem Details: If allocation fails after compaction then compaction may be deferred for a number of allocation attempts. If there are subsequent failures, compact_defer_shift is increased to defer for longer periods. This patch uses that information to scale the number of pages reclaimed with compact_defer_shift un...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index 99b434b674c0..f6fdae7a8d4c 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1729,6 +1729,28 @@ static bool in_reclaim_compaction(struct scan_control *sc) return false; } +#ifdef CONFIG_COMPACTION +/* + * If compaction is deferred for sc->order then scale the numbe...
4ffb6335da87b51c17e7ff6495170785f21558dd
Analyze and fix the following issue in the Linux kernel code: mm: compaction: update comment in try_to_compact_pages
Problem Details: Allocation success rates have been far lower since 3.4 due to commit fe2c2a106663 ("vmscan: reclaim at order 0 when compaction is enabled"). This commit was introduced for good reasons and it was known in advance that the success rates would suffer but it was justified on the grounds that the high allo...
```diff diff --git a/mm/compaction.c b/mm/compaction.c index 7fcd3a52e68d..7168edc7592c 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -869,11 +869,7 @@ unsigned long try_to_compact_pages(struct zonelist *zonelist, struct zone *zone; int rc = COMPACT_SKIPPED; - /* - * Check whether it is worth even starti...
6597d783397aebb793fb529474cce5089aa4c67f
Analyze and fix the following issue in the Linux kernel code: mm/mmap.c: replace find_vma_prepare() with clearer find_vma_links()
Problem Details: People get confused by find_vma_prepare(), because it doesn't care about what it returns in its output args, when its callers won't be interested. Clarify by passing in end-of-range address too, and returning failure if any existing vma overlaps the new range: instead of returning an ambiguous vma whi...
```diff diff --git a/mm/mmap.c b/mm/mmap.c index a76042dc806d..2ba27434e843 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -353,17 +353,14 @@ void validate_mm(struct mm_struct *mm) #define validate_mm(mm) do { } while (0) #endif -static struct vm_area_struct * -find_vma_prepare(struct mm_struct *mm, unsigned long addr, ...
d741c9cdeee6a569dae0dbbaf028065402955b59
Analyze and fix the following issue in the Linux kernel code: mm: fix nonuniform page status when writing new file with small buffer
Problem Details: When writing a new file with 2048 bytes buffer, such as write(fd, buffer, 2048), it will call generic_perform_write() twice for every page: write_begin mark_page_accessed(page) write_end write_begin mark_page_accessed(page) write_end Pages 1-13 will be added to lru-pvecs in write_begin() and w...
```diff diff --git a/mm/swap.c b/mm/swap.c index 77825883298f..f76c76c7501b 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -446,13 +446,22 @@ void mark_page_accessed(struct page *page) } EXPORT_SYMBOL(mark_page_accessed); +/* + * Order of operations is important: flush the pagevec when it's already + * full, not when ad...
e9714acf8c439688884234dcac2bfc38bb607d38
Analyze and fix the following issue in the Linux kernel code: mm: kill vma flag VM_EXECUTABLE and mm->num_exe_file_vmas
Problem Details: Currently the kernel sets mm->exe_file during sys_execve() and then tracks number of vmas with VM_EXECUTABLE flag in mm->num_exe_file_vmas, as soon as this counter drops to zero kernel resets mm->exe_file to NULL. Plus it resets mm->exe_file at last mmput() when mm->mm_users drops to zero. VMA with V...
```diff diff --git a/include/linux/mm.h b/include/linux/mm.h index 44d3fc25f556..25ef49c1f2bd 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -87,7 +87,6 @@ extern unsigned int kobjsize(const void *objp); #define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ #define V...
c654345924f7cce87bb221b89db91cba890421ba
Analyze and fix the following issue in the Linux kernel code: mm: remove __GFP_NO_KSWAPD
Problem Details: When transparent huge pages were introduced, memory compaction and swap storms were an issue, and the kernel had to be careful to not make THP allocations cause pageout or compaction. Now that we have working compaction deferral, kswapd is smart enough to invoke compaction and the quadratic behaviour ...
```diff diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 575730744fdb..b9adff543f5f 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -1056,8 +1056,7 @@ EXPORT_SYMBOL_GPL(mtd_writev); * until the request succeeds or until the allocation size falls below * the system page size. This a...
075663d19885eb3738fd2d7dbdb8947e12563b68
Analyze and fix the following issue in the Linux kernel code: CPU hotplug, debug: detect imbalance between get_online_cpus() and put_online_cpus()
Problem Details: The synchronization between CPU hotplug readers and writers is achieved by means of refcounting, safeguarded by the cpu_hotplug.lock. get_online_cpus() increments the refcount, whereas put_online_cpus() decrements it. If we ever hit an imbalance between the two, we end up compromising the guarantees ...
```diff diff --git a/kernel/cpu.c b/kernel/cpu.c index f560598807c1..42bd331ee0ab 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -80,6 +80,10 @@ void put_online_cpus(void) if (cpu_hotplug.active_writer == current) return; mutex_lock(&cpu_hotplug.lock); + + if (WARN_ON(!cpu_hotplug.refcount)) + cpu_hotplug.refc...
9b2a60c484715e2d2f07d8192fd9f18435cbc77c
Analyze and fix the following issue in the Linux kernel code: Kconfig: clean up the long arch list for the DEBUG_BUGVERBOSE config option
Problem Details: Introduce HAVE_DEBUG_BUGVERBOSE config option and select it in corresponding architecture Kconfig files. Architectures that already select GENERIC_BUG don't need to select HAVE_DEBUG_BUGVERBOSE. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.or...
```diff diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 5dc9273781d6..a30856058742 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -10,6 +10,7 @@ config ARM64 select GENERIC_TIME_VSYSCALL select HARDIRQS_SW_RESEND select HAVE_ARCH_TRACEHOOK + select HAVE_DEBUG_BUGVERBOSE select HAVE_DEBUG...
3b4d6c8283bd676e4e8dc2c3c96d4a024ca2d7f3
Analyze and fix the following issue in the Linux kernel code: ARM: imx: clk-imx27: Fix divider width field
Problem Details: As per mx27 reference manual, H264DIV and SSI2DIV are 6-bit wide fields in register PCDR0. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
```diff diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c index f69ca4680049..a85d330c3513 100644 --- a/arch/arm/mach-imx/clk-imx27.c +++ b/arch/arm/mach-imx/clk-imx27.c @@ -109,7 +109,7 @@ int __init mx27_clocks_init(unsigned long fref) clk[per3_div] = imx_clk_divider("per3_div", "mpll_main2...
121977187ca0a7f20b848530deb04cc56167769b
Analyze and fix the following issue in the Linux kernel code: Fix F_DUPFD_CLOEXEC breakage
Problem Details: Fix a braino in F_DUPFD_CLOEXEC; f_dupfd() expects flags for alloc_fd(), get_unused_fd() etc and there clone-on-exec if O_CLOEXEC, not FD_CLOEXEC. Reported-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundati...
```diff diff --git a/fs/fcntl.c b/fs/fcntl.c index 8f704291d4ed..71a600a19f06 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -258,7 +258,7 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg, err = f_dupfd(arg, filp, 0); break; case F_DUPFD_CLOEXEC: - err = f_dupfd(arg, filp, FD_CLOEXEC); + err =...
57451e437796548d658d03c2c4aab659eafcd799
Analyze and fix the following issue in the Linux kernel code: ASoC: fsi: don't reschedule DMA from an atomic context
Problem Details: shdma doesn't support transfer re-scheduling or triggering from callbacks or from atomic context. The fsi driver issues DMA transfers from a tasklet context, which is a bug. To fix it convert tasklet to a work. Reported-by: Do Q.Thang <dq-thang@jinso.co.jp> Tested-by: Do Q.Thang <dq-thang@jinso.co.jp>...
```diff diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index 5328ae5539f1..9d7f30774a44 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c @@ -20,6 +20,7 @@ #include <linux/sh_dma.h> #include <linux/slab.h> #include <linux/module.h> +#include <linux/workqueue.h> #include <sound/soc.h> #include <sound/s...
a92b078eab17d09ac600446954d8b0d7998c6168
Analyze and fix the following issue in the Linux kernel code: ASoC: fix documentation in soc-jack
Problem Details: Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
```diff diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c index fa0fd8ddae90..1ab5fe04bfcc 100644 --- a/sound/soc/soc-jack.c +++ b/sound/soc/soc-jack.c @@ -22,7 +22,7 @@ /** * snd_soc_jack_new - Create a new jack - * @card: ASoC card + * @codec: ASoC codec * @id: an identifying string for this jack ...
ca057410a8ea88ffb3ce6a581377cffa71ac01c6
Analyze and fix the following issue in the Linux kernel code: ARM: pxa: Fix build error caused by sram.h rename
Problem Details: Commit 293b2da1b61 ("ARM: pxa: move platform_data definitions") renamed arch/arm/mach-mmp/include/mach/sram.h to include/linux/platform_data/dma-mmp_tdma.h, but didn't update mmp-pcm.c which uses the header. Fix the build error. Signed-off-by: Chris Ball <cjb@laptop.org> Acked-by: Arnd Bergmann <arnd...
```diff diff --git a/sound/soc/pxa/mmp-pcm.c b/sound/soc/pxa/mmp-pcm.c index 73ac5463c9e4..e834faf859fd 100644 --- a/sound/soc/pxa/mmp-pcm.c +++ b/sound/soc/pxa/mmp-pcm.c @@ -15,13 +15,13 @@ #include <linux/slab.h> #include <linux/dma-mapping.h> #include <linux/dmaengine.h> +#include <linux/platform_data/dma-mmp_tdm...
e9332b6eed82973a8f75f1f3d57babaa331d703c
Analyze and fix the following issue in the Linux kernel code: ARM: OMAP4/AM335x: hwmod: fix disable_module regression in hardreset handling
Problem Details: Commit eb05f691290e99ee0bd1672317d6add789523c1e ("ARM: OMAP: hwmod: partially un-reset hwmods might not be properly enabled") added code to skip the IP block disable sequence if all of the block's hardreset lines weren't asserted. But this did not handle the case when no hardreset lines were associate...
```diff diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 299ca2821ad1..b969ab1d258b 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -1697,6 +1697,29 @@ static bool _are_all_hardreset_lines_asserted(struct omap_hwmod *oh) return false; } ...
cf956d9f0734b4888655d6b7420e4dac9dba22d0
Analyze and fix the following issue in the Linux kernel code: ARM: OMAP3: fix workaround for EMU clockdomain
Problem Details: Commit b71c721 (ARM: OMAP2+: clockdomain/hwmod: add workaround for EMU clockdomain idle problems) added a workaround for the EMU clock domain on OMAP3/4 devices to prevent the clock domain for transitioning while it is in use. In the proposed patch [1] code was added to the omap3xxx_clkdm_clk_enable()...
```diff diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c index 9a7792aec673..70294f54e35a 100644 --- a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c +++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c @@ -183,17 +183,6 @@ static int omap2_clkdm_clk_enable(struct clockdomain...
66eef59f22275002f621ff9d951886b513d011b3
Analyze and fix the following issue in the Linux kernel code: net: fix typo in freescale/ucc_geth.c
Problem Details: The following patch: acb600d net: remove skb recycling added dev_free_skb() to drivers/net/ethernet/freescale/ucc_geth.c This is a typo and should be dev_kfree_skb(). This fixes this. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index dfa0aaaab009..0a70bb55d1b0 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -3268,7 +3268,7 @@ static int ucc_geth_rx(struct ucc_geth_private *ugeth, ...
b61a602ee6730150f4d0df730d9312ac4d820ceb
Analyze and fix the following issue in the Linux kernel code: ipvs: initialize returned data in do_ip_vs_get_ctl
Problem Details: As reported by a gcc warning, the do_ip_vs_get_ctl does not initalize all the members of the ip_vs_timeout_user structure it returns if at least one of the TCP or UDP protocols is disabled for ipvs. This makes sure that the data is always initialized, before it is returned as a response to IPVS_CMD_GE...
```diff diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 7e7198b51c06..c4ee43710aab 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c @@ -2589,6 +2589,8 @@ __ip_vs_get_timeouts(struct net *net, struct ip_vs_timeout_user *u) struct ip_vs_proto_data *pd; ...
bbebb4ebc86e723a2c38c651dbfe54017333d307
Analyze and fix the following issue in the Linux kernel code: drm/nouveau/fan: fix a typo in PWM's input clock calculation
Problem Details: Reported-by: Jukka Hopeavuori <jukka.hopea@gmail.com> Signed-off-by: Martin Peres <martin.peres@labri.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
```diff diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/nv50.c b/drivers/gpu/drm/nouveau/core/subdev/therm/nv50.c index f87a7a3eb4e7..9360ddd469e7 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/nv50.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/nv50.c @@ -92,7 +92,7 @@ nv50_fan_pwm_clock(struct nouve...
b47f1421ad2946b71b32e613d161a8ee43d2d019
Analyze and fix the following issue in the Linux kernel code: drm/nv50/clk: wire up pll_calc hook
Problem Details: Fixes crash during reclocking. Call Trace: pll_calc == NULL calc_pll calc_mclk nv50_pm_clocks_pre nouveau_pm_perflvl_set nouveau_pm_trigger nouveau_pm_profile_set nouveau_pm_set_perflvl dev_attr_store sysfs_write_file vfs_write sys_write system_call_fastpath Signed-off-by: Marcin Slusarz ...
```diff diff --git a/drivers/gpu/drm/nouveau/core/subdev/clock/nv50.c b/drivers/gpu/drm/nouveau/core/subdev/clock/nv50.c index fd181fbceddb..f4147f67eda6 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/clock/nv50.c +++ b/drivers/gpu/drm/nouveau/core/subdev/clock/nv50.c @@ -90,6 +90,7 @@ nv50_clock_ctor(struct nouveau_...
cf31cd1a0c692a1445c80756055875088fa29982
Analyze and fix the following issue in the Linux kernel code: ACPI idle, CPU hotplug: Fix NULL pointer dereference during hotplug
Problem Details: On a KVM guest, when a CPU is taken offline and brought back online, we hit the following NULL pointer dereference: [ 45.400843] Unregister pv shared memory for cpu 1 [ 45.412331] smpboot: CPU 1 is now offline [ 45.529894] SMP alternatives: lockdep: fixing up alternatives [ 45.533472] smpboot:...
```diff diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index e28f6ea46f1a..7f15b8514a18 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -368,7 +368,7 @@ EXPORT_SYMBOL_GPL(cpuidle_enable_device); */ void cpuidle_disable_device(struct cpuidle_device *dev) { - if (!dev->en...
e8b1b59dc8e42a47c4ce541bd1767ffac206b29c
Analyze and fix the following issue in the Linux kernel code: cpuidle / ACPI: fix potential NULL pointer dereference
Problem Details: The dereference should be moved below the NULL test. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Len Brown <len.brown@intel.com>
```diff diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 3655ab923812..e8086c725305 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1132,7 +1132,7 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr) int acpi_processor_hotplug(s...
9a334cd0de2f43b29c192548000692bad52edfc6
Analyze and fix the following issue in the Linux kernel code: drm/nouveau/bios: fix shadowing of ACPI ROMs larger than 64KiB
Problem Details: Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
```diff diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c index 2fbb6df697cd..dcb5c2befc92 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c @@ -185,23 +185,22 @@ static void nouveau_bios_shado...
0aa4a17d8232e7d8a42763b53bb9943bc0484b18
Analyze and fix the following issue in the Linux kernel code: Btrfs: handle not finding the extent exactly when logging changed extents
Problem Details: I started hitting warnings when running xfstest 68 in a loop because there were EM's that were not lined up properly with the physical extents. This is ok, if we do something like punch a hole or write to a preallocated space or something like that we can have an EM that doesn't cover the entire physi...
```diff diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index ed1f7ce7219a..e0ef92f91d66 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -2833,6 +2833,7 @@ static int log_one_extent(struct btrfs_trans_handle *trans, struct btrfs_file_extent_item *fi; struct btrfs_key key; u64 start = em->mod_...
8732d44f806a9da9a7ca4d1704b8a1ed81639bc4
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix the missing error information in create_pending_snapshot()
Problem Details: The macro btrfs_abort_transaction() can get the line number of the code where the problem happens, so we should invoke it in the place that the error occurs, or we will lose the line number. Reported-by: David Sterba <dave@jikos.cz> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
```diff diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index a4fe5494d01b..910ff8051ba9 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1073,7 +1073,8 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, goto fail; } else if (IS_ERR(dir_item)) { ret...
aa42ffd918c420d5625b25b7a0bc2bbde4c9f890
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix off-by-one in file clone
Problem Details: Btrfs uses inclusive range end for lock_extent(), unlock_extent() and related functions, so we made off-by-one errors in file clone. This fixes it and also fixes some style problems. Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
```diff diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 4d7f4bbf4c96..d6836af6d60f 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2481,13 +2481,13 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, another, and lock file content */ while (1) { struct btrfs_order...
533b298110475804b15b93475389736140bf4aa9
Analyze and fix the following issue in the Linux kernel code: ARM: OMAP: fix return value check in realtime_counter_init()
Problem Details: In case of error, the function clk_get() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> ...
```diff diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 8847d6eb2313..44f9aa7ec0c0 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -378,7 +378,7 @@ static void __init realtime_counter_init(void) return; } sys_clk = clk_get(NULL, "sys_clkin_ck"); - if (!s...
64de3a00a16bcdf940cbebb1b2dc05d7cc13fef5
Analyze and fix the following issue in the Linux kernel code: ARM: OMAP: hsmmc: fix return value check in omap_hsmmc_init_one()
Problem Details: In case of error, the function omap_device_alloc() returns ERR_PTR() not NULL pointer. The NULL test in the return value check should be replaced with IS_ERR(). dpatch engine is used to auto generated this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com...
```diff diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c index 03ebf47cfa9a..4d3a6324155f 100644 --- a/arch/arm/mach-omap2/hsmmc.c +++ b/arch/arm/mach-omap2/hsmmc.c @@ -523,7 +523,7 @@ static void __init omap_hsmmc_init_one(struct omap2_hsmmc_info *hsmmcinfo, dev_set_name(&pdev->dev, "%s.%d", pd...
9ee677231bbc6a9e6ec9057d33d81eb248742b0a
Analyze and fix the following issue in the Linux kernel code: OMAPDSS: fix return value check in create_dss_pdev()
Problem Details: In case of error, the function omap_device_alloc() returns ERR_PTR() not NULL pointer. The NULL test in the return value check should be replaced with IS_ERR(). dpatch engine is used to auto generated this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com...
```diff diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 7012068ccbf6..a51ece491b91 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -221,7 +221,7 @@ static struct platform_device *create_dss_pdev(const char *pdev_name, ohs[0] = oh; od = omap_device...
4f806819270bb1170057cfe9ed5c466f3535be83
Analyze and fix the following issue in the Linux kernel code: ARM: OMAP: OMAP_DEBUG_LEDS needs to select LEDS_CLASS
Problem Details: This fixes below build error when CONFIG_LEDS_CLASS is not set. LD init/built-in.o arch/arm/plat-omap/built-in.o: In function `fpga_probe': arch/arm/plat-omap/debug-leds.c:113: undefined reference to `led_classdev_register' make: *** [vmlinux] Error 1 Signed-off-by: Axel Lin <axel.lin@gmail.co...
```diff diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index ca83a7659aef..c26278172caa 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig @@ -43,6 +43,7 @@ config OMAP_DEBUG_DEVICES config OMAP_DEBUG_LEDS def_bool y if NEW_LEDS + select LEDS_CLASS depends on OMAP_DEBU...
e2ee1b4d86f53c49c06a14dc10616f6d8aa05ea9
Analyze and fix the following issue in the Linux kernel code: cpufreq: OMAP: fix clock usage to be SoC independent, remove plat/ includes
Problem Details: OMAP core code now has SoC-independent clock alias for the scalable CPU clock. Using it means driver is SoC independent and will work for AM3xxx SoCs as well as OMAP1/3/4. While here, remove some unnecessary plat/ includes that are interfering with multi-subarch ARM kernels. Signed-off-by: Paul Walm...
```diff diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c index 7d4d4559e522..5d1f5e442ecc 100644 --- a/drivers/cpufreq/omap-cpufreq.c +++ b/drivers/cpufreq/omap-cpufreq.c @@ -30,19 +30,14 @@ #include <asm/smp_plat.h> #include <asm/cpu.h> -#include <plat/clock.h> -#include <plat/common.h>...
7c41c42c5d9db9efd8caab4764e912458a1a1a79
Analyze and fix the following issue in the Linux kernel code: vxlan: fix more sparse warnings
Problem Details: Fix a couple harmless sparse warnings reported by Fengguang Wu. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 6f95580bf9d4..8be9bf07bd39 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -1083,13 +1083,13 @@ static int vxlan_fill_info(struct sk_buff *skb, const struct net_device *dev) if (nla_put_u32(skb, IFLA_VXLAN_ID, vxlan->vni)) goto nla_...
d5bbd43d5f450c3fca058f5b85f3dfb4e8cc88c9
Analyze and fix the following issue in the Linux kernel code: exec: make de_thread() killable
Problem Details: Change de_thread() to use KILLABLE rather than UNINTERRUPTIBLE while waiting for other threads. The only complication is that we should clear ->group_exit_task and ->notify_count before we return, and we should do this under tasklist_lock. -EAGAIN is used to match the initial signal_group_exit() chec...
```diff diff --git a/fs/exec.c b/fs/exec.c index 9824473a7ec1..19f4fb80cd17 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -878,9 +878,11 @@ static int de_thread(struct task_struct *tsk) sig->notify_count--; while (sig->notify_count) { - __set_current_state(TASK_UNINTERRUPTIBLE); + __set_current_state(TASK_KILLABLE...
ad4d3ef8b7eb527cca478dc08c02c10936e64115
Analyze and fix the following issue in the Linux kernel code: ipvs: fix ARP resolving for direct routing mode
Problem Details: After the change "Make neigh lookups directly in output packet path" (commit a263b30936) IPVS can not reach the real server for DR mode because we resolve the destination address from IP header, not from route neighbour. Use the new FLOWI_FLAG_KNOWN_NH flag to request output routes with known nexthop, ...
```diff diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c index 56f6d5d81a77..cc4c8095681a 100644 --- a/net/netfilter/ipvs/ip_vs_xmit.c +++ b/net/netfilter/ipvs/ip_vs_xmit.c @@ -50,6 +50,7 @@ enum { * local */ IP_VS_RT_MODE_CONNECT = 8, /* Always bind route to saddr ...
e0adef0f7456d5d3a3bfe8ea61c7dddf146b40e1
Analyze and fix the following issue in the Linux kernel code: ipv4: fix forwarding for strict source routes
Problem Details: After the change "Adjust semantics of rt->rt_gateway" (commit f8126f1d51) rt_gateway can be 0 but ip_forward() compares it directly with nexthop. What we want here is to check if traffic is to directly connected nexthop and to fail if using gateway. Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-o...
```diff diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c index ab09b126423c..7f35ac26a71a 100644 --- a/net/ipv4/ip_forward.c +++ b/net/ipv4/ip_forward.c @@ -85,7 +85,7 @@ int ip_forward(struct sk_buff *skb) rt = skb_rtable(skb); - if (opt->is_strictroute && opt->nexthop != rt->rt_gateway) + if (opt->is_...
e81da0e113a1b7fc7449ae6213f65f89ccac6d06
Analyze and fix the following issue in the Linux kernel code: ipv4: fix sending of redirects
Problem Details: After "Cache input routes in fib_info nexthops" (commit d2d68ba9fe) and "Elide fib_validate_source() completely when possible" (commit 7a9bc9b81a) we can not send ICMP redirects. It seems we should not cache the RTCF_DOREDIRECT flag in nh_rth_input because the same fib_info can be used for traffic that...
```diff diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 68c93d1bb03a..825c608826de 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -322,7 +322,8 @@ int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst, { int r = secpath_exists(skb) ? 0 : IN_DEV_RPFILTER(idev)...
12aee6c69f245189dc015227d1c27240a832f58a
Analyze and fix the following issue in the Linux kernel code: ARM: OMAP: rx51: Fix a section mismatch warn
Problem Details: rx51_si4713_dev is referenced only from rx51_init_si4713. So the memory for rx51_si4713_dev can be safely freed after init. Also it references rx51_si4713_board_info which is __initdata_or_module. fixes the below warning. WARNING: vmlinux.o(.data+0x30958): Section mismatch in reference from the varia...
```diff diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index ed85fb898c7f..020e03c95bfe 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c @@ -748,7 +748,7 @@ static struct radio_si4713_platform_data rx51...
863472454ce50d4ef0929c6aa738cc5d64b84679
Analyze and fix the following issue in the Linux kernel code: ipv6: gro: fix PV6_GRO_CB(skb)->proto problem
Problem Details: It seems IPV6_GRO_CB(skb)->proto can be destroyed in skb_gro_receive() if a new skb is allocated (to serve as an anchor for frag_list) We copy NAPI_GRO_CB() only (not the IPV6 specific part) in : *NAPI_GRO_CB(nskb) = *NAPI_GRO_CB(p); So we leave IPV6_GRO_CB(nskb)->proto to 0 (fresh skb allocation) i...
```diff diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 0a36fff75bd5..561c8bc8976d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1513,6 +1513,9 @@ struct napi_gro_cb { /* jiffies when first packet was created/queued */ unsigned long age; + + /* Used in ipv6_gr...
48cc32d38a52d0b68f91a171a8d00531edc6a46e
Analyze and fix the following issue in the Linux kernel code: vlan: don't deliver frames for unknown vlans to protocols
Problem Details: 6a32e4f9dd9219261f8856f817e6655114cfec2f made the vlan code skip marking vlan-tagged frames for not locally configured vlans as PACKET_OTHERHOST if there was an rx_handler, as the rx_handler could cause the frame to be received on a different (virtual) vlan-capable interface where that vlan might be co...
```diff diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index e6ff12dd717b..c0ff748d0aa5 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -80,6 +80,8 @@ static inline int is_vlan_dev(struct net_device *dev) } #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESEN...
c3e7724b6bc2f25e46c38dbe68f09d71fafeafb8
Analyze and fix the following issue in the Linux kernel code: mac80211: use ieee80211_free_txskb to fix possible skb leaks
Problem Details: A few places free skbs using dev_kfree_skb even though they're called after ieee80211_subif_start_xmit might have cloned it for tracking tx status. Use ieee80211_free_txskb here to prevent skb leaks. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@vger.kernel.org Signed-off-by: John W. Linvi...
```diff diff --git a/net/mac80211/status.c b/net/mac80211/status.c index 2ce89732d0f2..3af0cc4130f1 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c @@ -34,7 +34,7 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, skb_queue_len(&local->skb_queue_unreliable); while (tmp > IEEE80211_IRQSAFE_...
5bcbc3fcbd88842765aa419934602d3930c6ed3c
Analyze and fix the following issue in the Linux kernel code: carl9170: fix sleep in softirq context
Problem Details: This patch fixes the following bug: usb 1-1.1: restart device (8) BUG: sleeping function called from invalid context at drivers/usb/core/urb.c:654 in_atomic(): 1, irqs_disabled(): 0, pid: 0, name: swapper (usb_poison_urb+0x1c/0xf8) (usb_poison_anchored_urbs+0x48/0x78) (carl9170_usb_handle_tx_err+0x...
```diff diff --git a/drivers/net/wireless/ath/carl9170/carl9170.h b/drivers/net/wireless/ath/carl9170/carl9170.h index 2aa4a59c72c8..2df17f1e49ef 100644 --- a/drivers/net/wireless/ath/carl9170/carl9170.h +++ b/drivers/net/wireless/ath/carl9170/carl9170.h @@ -303,6 +303,7 @@ struct ar9170 { unsigned long queue_stop_ti...
9c371f997353385dfa2f7a8004ce13397e071a25
Analyze and fix the following issue in the Linux kernel code: ath5k: fix potential NULL pointer dereference in ath5k_beacon_update()
Problem Details: The dereference should be moved below the NULL test. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: John W. Linville <linville@tuxdriver.com>
```diff diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 9fd6d9a9942e..9f31cfa56cc0 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c @@ -1804,7 +1804,7 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif)...
2e71a6f8084e7ac87166dd77d99c44190fb844fc
Analyze and fix the following issue in the Linux kernel code: net: gro: selective flush of packets
Problem Details: Current GRO can hold packets in gro_list for almost unlimited time, in case napi->poll() handler consumes its budget over and over. In this case, napi_complete()/napi_gro_flush() are not called. Another problem is that gro_list is flushed in non friendly way : We scan the list and complete packets in...
```diff diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c index 3f7dab46626b..9b9c2ac5c4c2 100644 --- a/drivers/net/ethernet/marvell/skge.c +++ b/drivers/net/ethernet/marvell/skge.c @@ -3189,7 +3189,7 @@ static int skge_poll(struct napi_struct *napi, int to_do) if (work_done < to_...
1510a1a2d0946b34422fe8816187f274a5086904
Analyze and fix the following issue in the Linux kernel code: usb: trival: Fix debugging units mistake.
Problem Details: SEL and PEL are in microseconds, not milliseconds. Also, fix a split string that will trigger checkpatch warnings. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
```diff diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index b8e11fff17be..64854d76f529 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -3241,8 +3241,7 @@ static int usb_req_set_sel(struct usb_device *udev, enum usb3_link_state state) (state == USB3_LPM_U2 && (u2_sel > USB3_LP...
ae8963adb4ad8c5f2a89ca1d99fb7bb721e7599f
Analyze and fix the following issue in the Linux kernel code: usb: Don't enable LPM if the exit latency is zero.
Problem Details: Some USB 3.0 devices signal that they don't implement Link PM by having all zeroes in the U1/U2 exit latencies in their SuperSpeed BOS descriptor. Don found that a Western Digital device he has experiences transfer errors when LPM is enabled. The lsusb shows the U1/U2 exit latencies are set to zero: ...
```diff diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 673ee4696262..8f0478709323 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -3415,6 +3415,16 @@ static void usb_enable_link_state(struct usb_hcd *hcd, struct usb_device *udev, enum usb3_link_state state) { int timeout; +...
a2af139ff1cd85df586690ff626619ab1ee88b0a
Analyze and fix the following issue in the Linux kernel code: skge: Add DMA mask quirk for Marvell 88E8001 on ASUS P5NSLI motherboard
Problem Details: Marvell 88E8001 on an ASUS P5NSLI motherboard is unable to send/receive packets on a system with >4gb ram unless a 32bit DMA mask is used. This issue has been around for years and a fix was sent 3.5 years ago, but there was some debate as to whether it should instead be fixed as a PCI quirk. http://ww...
```diff diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c index 91836b54da35..3f7dab46626b 100644 --- a/drivers/net/ethernet/marvell/skge.c +++ b/drivers/net/ethernet/marvell/skge.c @@ -4155,6 +4155,13 @@ static struct dmi_system_id skge_32bit_dma_boards[] = { DMI_MATCH(DMI_BOAR...
404d9e3fc322023619cf0a9c5c6efbbaf7e14ee8
Analyze and fix the following issue in the Linux kernel code: cxgb4: Address various sparse warnings
Problem Details: This patch fixes type assignment issues, function definition and symbol shadowing which triggered sparse warnings. Signed-off-by: Jay Hernandez <jay@chelsio.com> Signed-off-by: Vipul Pandya <vipul@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h index 31752b24434e..a4da893ac1e1 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h @@ -696,6 +696,7 @@ int t4_seeprom_wp(struct adapter *adapter, bool enabl...
ee9a8f7ab2edf801b8b514c310455c94acc232f6
Analyze and fix the following issue in the Linux kernel code: ipv4: Don't report stale pmtu values to userspace
Problem Details: We report cached pmtu values even if they are already expired. Change this to not report these values after they are expired and fix a race in the expire time calculation, as suggested by Eric Dumazet. Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: David S. Miller <davem...
```diff diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 741df67a81ec..132e0dfee53a 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2187,8 +2187,18 @@ static int rt_fill_info(struct net *net, __be32 dst, __be32 src, nla_put_be32(skb, RTA_GATEWAY, rt->rt_gateway)) goto nla_put_failure; + expir...
6916fd086f0c5d7871ad3986300ba30d63616925
Analyze and fix the following issue in the Linux kernel code: arm64: Enable interrupts before calling do_notify_resume()
Problem Details: task_work_run() implementation had the side effect of enabling interrupts. With commit ac3d0da8 (task_work: Make task_work_add() lockless), interrupts are no longer enabled revealing the bug in the arch code. This patch enables the interrupt explicitly before calling do_notify_resume(). Signed-off-by:...
```diff diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 38cf853a3667..6538928ff1ab 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -583,6 +583,7 @@ work_pending: mov x0, sp // 'regs' tst x2, #PSR_MODE_MASK // user mode regs? b.ne no_work_pending // returnin...
a4fbe35a124526e6759be07bd9c7ea796ba1e00d
Analyze and fix the following issue in the Linux kernel code: rcu: Grace-period initialization excludes only RCU notifier
Problem Details: Kirill noted the following deadlock cycle on shutdown involving padata: > With commit 755609a9087fa983f567dc5452b2fa7b089b591f I've got deadlock on > poweroff. > > It guess it happens because of race for cpu_hotplug.lock: > > CPU A CPU B > disable_nonboot_cpus()...
```diff diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 4fb2376ddf06..74df86bd9204 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c @@ -74,6 +74,7 @@ static struct lock_class_key rcu_fqs_class[RCU_NUM_LVLS]; .orphan_nxttail = &sname##_state.orphan_nxtlist, \ .orphan_donetail = &sname##_state.orphan_donel...
8936fa6d1c202abeb94c51c68897342e8714dd69
Analyze and fix the following issue in the Linux kernel code: Bluetooth: L2CAP: Fix using default Flush Timeout for EFS
Problem Details: There are two Flush Timeouts: one is old Flush Timeot Option which is 2 octets and the second is Flush Timeout inside EFS which is 4 octets long. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
```diff diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 7002f0d656ed..caab98c45121 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h @@ -32,7 +32,8 @@ /* L2CAP defaults */ #define L2CAP_DEFAULT_MTU 672 #define L2CAP_DEFAULT_MIN_MTU 48 -#define L2CAP_DEF...
2eb6862aaf7ea0685c997d833c3890dae2f94a62
Analyze and fix the following issue in the Linux kernel code: [SCSI] lpfc 8.3.35: Fix error with fabric service parameters causing performance issues
Problem Details: Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
```diff diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index c23f6415f76d..f19e9b6f9f13 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -809,6 +809,8 @@ lpfc_cmpl_els_flogi_nport(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, phba->fc_ratov = FF_DEF_RAT...
2a94aea436759453833008df9457cb90faa15107
Analyze and fix the following issue in the Linux kernel code: [SCSI] lpfc 8.3.35: Fix FCP2 Retries for non-r/w commands.
Problem Details: Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
```diff diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index f4ab975985a4..d7f3313ef886 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -8109,6 +8109,8 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, bf_set(wqe_lenloc, &wqe->fcp_icmd.wq...
e0654d0177a85490b3e61b080a09aace66805c0a
Analyze and fix the following issue in the Linux kernel code: ARM: imx: fix the return value check in imx_clk_busy_divider()
Problem Details: In case of error, the function clk_register() returns ERR_PTR() no NULL pointer. The NULL test in the return value check should be replaced with IS_ERR(). dpatch engine is used to auto generated this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> S...
```diff diff --git a/arch/arm/mach-imx/clk-busy.c b/arch/arm/mach-imx/clk-busy.c index 1a7a8dd045a1..1ab91b5209e6 100644 --- a/arch/arm/mach-imx/clk-busy.c +++ b/arch/arm/mach-imx/clk-busy.c @@ -108,7 +108,7 @@ struct clk *imx_clk_busy_divider(const char *name, const char *parent_name, busy->div.hw.init = &init; ...
005ffa704431a8d98ad313d4fa285a5d9bce37bc
Analyze and fix the following issue in the Linux kernel code: [SCSI] lpfc 8.3.35: Fix incorrect comment in T10 DIF attributes
Problem Details: Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
```diff diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index b032562aa0d9..ad16e54ac383 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -3935,6 +3935,12 @@ MODULE_PARM_DESC(lpfc_fcp_look_ahead, "Look ahead for completions"); # - Only meaningful if BG is tu...
ee02006b5336db1a259f34c3a390be43b32063b7
Analyze and fix the following issue in the Linux kernel code: [SCSI] lpfc 8.3.35: Fix interrupt delay multipler conversion for eq_create
Problem Details: Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
```diff diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 219bf534ef99..f0e5aea80810 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -12099,6 +12099,7 @@ lpfc_modify_fcp_eq_delay(struct lpfc_hba *phba, uint16_t startq) struct lpfc_queue *eq; int cnt, rc, ...
1d10ecf8371be22c68b2e52e7376c7075c97f656
Analyze and fix the following issue in the Linux kernel code: ARM: imx: fix return value check in imx3_init_l2x0()
Problem Details: In case of error, the function ioremap() returns NULL not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-of...
```diff diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c index 9d2c843bde02..b5deb0554552 100644 --- a/arch/arm/mach-imx/mm-imx3.c +++ b/arch/arm/mach-imx/mm-imx3.c @@ -108,9 +108,8 @@ void __init imx3_init_l2x0(void) } l2x0_base = ioremap(MX3x_L2CC_BASE_ADDR, 4096); - if (IS_ERR(l2x0_base))...
a9627b881680c4419c61e70f60e8f957d8ef225c
Analyze and fix the following issue in the Linux kernel code: drm/i915: Remove the WaDisableBackToBackFlipFix w/a for Haswell
Problem Details: This workaround is only valid for IVB and VLV and the write triggers an error on HSW. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanonI@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
```diff diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 0dd2ca707d0a..eb757e5f2d87 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -3474,10 +3474,6 @@ static void haswell_init_clock_gating(struct drm_device *dev) I915_WRITE(_3D_CHICKEN3, ...
62cb944fa24728d164497834e4181ba0d266b32b
Analyze and fix the following issue in the Linux kernel code: drm/i915: Document that we are implementing WaDisableBackToBackFlipFix
Problem Details: For the next person that checks these kind of things, without having to dig up the register definition. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
```diff diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index b5b772af6b81..0dd2ca707d0a 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -3536,6 +3536,7 @@ static void ivybridge_init_clock_gating(struct drm_device *dev) I915_WRITE(_3D_CHICKEN3, ...
5204e4787b89a281be88a2eb57407165da2757ad
Analyze and fix the following issue in the Linux kernel code: Blackfin: fix wrong place disabled irq
Problem Details: Shouldn't disable irq before send ipi. Signed-off-by: Steven Miao <realmz6@gmail.com> Signed-off-by: Bob Liu <lliubbo@gmail.com>
```diff diff --git a/arch/blackfin/kernel/reboot.c b/arch/blackfin/kernel/reboot.c index 5272e6eefd92..c4f50a328501 100644 --- a/arch/blackfin/kernel/reboot.c +++ b/arch/blackfin/kernel/reboot.c @@ -86,7 +86,6 @@ void native_machine_restart(char *cmd) void machine_restart(char *cmd) { native_machine_restart(cmd); -...
810f1512dc8a1f64c22229c3def85fc398b6a24f
Analyze and fix the following issue in the Linux kernel code: Blackfin: cpufreq: fix dpm_state_table
Problem Details: This patch fixes an assumption that cclk's initial divisor will always be 1 (or 0 in the register). TSCALE is always initialized on startup with a value of 4 regardless of the inital cclk divisor; so, we can't make the assumption without making lots of other assumptions. The TPERIOD value is set with...
```diff diff --git a/arch/blackfin/mach-common/cpufreq.c b/arch/blackfin/mach-common/cpufreq.c index c854a27cbeab..65a4511e1d1f 100644 --- a/arch/blackfin/mach-common/cpufreq.c +++ b/arch/blackfin/mach-common/cpufreq.c @@ -77,15 +77,14 @@ static void __init bfin_init_tables(unsigned long cclk, unsigned long sclk) cse...
ce8609146d09df213ed1e842ece7ad477e0ab7a6
Analyze and fix the following issue in the Linux kernel code: Blackfin: bfin_gpio: proc: fix return value
Problem Details: Signed-off-by: Steven Miao <realmz6@gmail.com> Signed-off-by: Bob Liu <lliubbo@gmail.com>
```diff diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c index 83139aaf3072..ed978f1c5cb9 100644 --- a/arch/blackfin/kernel/bfin_gpio.c +++ b/arch/blackfin/kernel/bfin_gpio.c @@ -1265,8 +1265,8 @@ static __init int gpio_register_proc(void) { struct proc_dir_entry *proc_gpio; - proc_...
57820b34690ab6c8b367d6b8b61c21a1fe99f867
Analyze and fix the following issue in the Linux kernel code: Blackfin: bf537: fix lq035 platform device name
Problem Details: Lq035 fb driver uses KBUILD_MODNAME which is bf537_lq035 instead of bf537-lq035. Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com> Signed-off-by: Bob Liu <lliubbo@gmail.com>
```diff diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index 5ed654ae66e1..6acbead90fad 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c @@ -1525,7 +1525,7 @@ static struct platform_device bfin_sport_spi1_device = { #if...
0b1568a4536ff287a87908d7fc35c05bd7736a53
Analyze and fix the following issue in the Linux kernel code: RSA: Fix signature verification for shorter signatures
Problem Details: gpg can produce a signature file where length of signature is less than the modulus size because the amount of space an MPI takes up is kept as low as possible by discarding leading zeros. This regularly happens for several modules during the build. Fix it by relaxing check in RSA verification code. ...
```diff diff --git a/crypto/asymmetric_keys/rsa.c b/crypto/asymmetric_keys/rsa.c index 9b31ee25a459..4a6a0696f8a3 100644 --- a/crypto/asymmetric_keys/rsa.c +++ b/crypto/asymmetric_keys/rsa.c @@ -224,15 +224,23 @@ static int RSA_verify_signature(const struct public_key *key, return -ENOTSUPP; /* (1) Check the sig...
b7a10626c8bc88fd097a8bb4486c89558f89320c
Analyze and fix the following issue in the Linux kernel code: [CIFS] WARN_ON_ONCE if kernel_sendmsg() returns -ENOSPC
Problem Details: kernel_sendmsg() is less likely to return -ENOSPC and it might be a bug to do so. However, in the past there might have been cases where a -ENOSPC was returned from a low level driver. Add a WARN_ON_ONCE() to ensure that it is safe to assume that -ENOSPC is no longer returned. This -ENOSPC specific ha...
```diff diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 2126ab185045..76d974c952fe 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -183,6 +183,12 @@ smb_send_kvec(struct TCP_Server_Info *server, struct kvec *iov, size_t n_vec, rc = kernel_sendmsg(ssocket, &smb_msg, &iov[first_vec], ...
85e34368dea6fc8a2d16464e01c85d3b7bd682bd
Analyze and fix the following issue in the Linux kernel code: Bluetooth: Fix dereference after NULL check
Problem Details: Move code dereferencing possible NULL pointer to the check branch. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
```diff diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 2542abd3336f..a71c4089d175 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c @@ -382,13 +382,14 @@ static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname, ch } memset(&sec, 0, sizeof(s...
079db0c6e3854b3af9808268f3b884fa48ed0034
Analyze and fix the following issue in the Linux kernel code: Bluetooth: AMP: Fix possible NULL dereference
Problem Details: Check that link key exist before accessing. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
```diff diff --git a/net/bluetooth/amp.c b/net/bluetooth/amp.c index 5dab2d1c7c82..b6e1c3ac74f1 100644 --- a/net/bluetooth/amp.c +++ b/net/bluetooth/amp.c @@ -184,6 +184,10 @@ int phylink_gen_key(struct hci_conn *conn, u8 *data, u8 *len, u8 *type) *len = HCI_AMP_LINK_KEY_SIZE; key = hci_find_link_key(hdev, &conn-...
096947fdab96fd97df47b10b8547382290ef9fcd
Analyze and fix the following issue in the Linux kernel code: arm: vt8500: Fix build warning in uncompress.h
Problem Details: This removes a build-time warning in uncompress.h due to incorrectly cast values being passed to readb/writeb. Removed arm/io.h and readb/writeb. Read/write directly to the serial port with a volatile pointer. Signed-off-by: Tony Prisk <linux@prisktech.co.nz> Signed-off-by: Olof Johansson <olof@lixom...
```diff diff --git a/arch/arm/mach-vt8500/include/mach/uncompress.h b/arch/arm/mach-vt8500/include/mach/uncompress.h index bb9e2d23fee3..e6e81fdaf109 100644 --- a/arch/arm/mach-vt8500/include/mach/uncompress.h +++ b/arch/arm/mach-vt8500/include/mach/uncompress.h @@ -15,15 +15,15 @@ * */ -#define UART0_PHYS 0xd820...
e6c085863f97f0a8f009753e1baaf83e4aac7b42
Analyze and fix the following issue in the Linux kernel code: mmc: core: Fixup broken suspend and eMMC4.5 power off notify
Problem Details: This patch fixes up the broken suspend sequence for eMMC with sleep support. Additionally it reworks the eMMC4.5 Power Off Notification feature so it fits together with the existing sleep feature. The CMD0 based re-initialization of the eMMC at resume is re-introduced to maintain compatiblity for devi...
```diff diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 66121633c9cd..06c42cfb7c34 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1273,48 +1273,6 @@ void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type) mmc_host_clk_release(host); } -static void mmc_pow...
067bf748bde70154a1fe1734b01f82b827c65b23
Analyze and fix the following issue in the Linux kernel code: mmc: sdhci-spear: add device tree bindings
Problem Details: This adds simple DT bindings for SDHCI SPEAr controller. It uses cd-gpios from common mmc bindings. This also fixes spear300-evb.dts with correct name for card detect binding. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
```diff diff --git a/Documentation/devicetree/bindings/mmc/sdhci-spear.txt b/Documentation/devicetree/bindings/mmc/sdhci-spear.txt new file mode 100644 index 000000000000..84d6e297908f --- /dev/null +++ b/Documentation/devicetree/bindings/mmc/sdhci-spear.txt @@ -0,0 +1,21 @@ +* SPEAr SDHCI Controller + +This file docum...
5feb54a1ab91a237e247c013b8c4fb100ea347b1
Analyze and fix the following issue in the Linux kernel code: mmc: sdhci-s3c: fix the wrong number of max bus clocks
Problem Details: We can use up to four bus-clocks; but on module remove, we didn't disable the fourth bus clock. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Chris Ball <cjb@laptop.org>
```diff diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index f64108f2664a..e0196726b132 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c @@ -792,7 +792,7 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); clk...
c77d7162a7ae451c2e895d7ef7fbeb0906107472
Analyze and fix the following issue in the Linux kernel code: drm/i915: remove useless BUG_ON which caused a regression in 3.5.
Problem Details: starting an old X server causes a kernel BUG since commit 1b50247a8d: ------------[ cut here ]------------ kernel BUG at drivers/gpu/drm/i915/i915_gem.c:3661! invalid opcode: 0000 [#1] SMP Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss ...
```diff diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index b55eee38af76..53de95c05b16 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -4099,7 +4099,6 @@ i915_gem_entervt_ioctl(struct drm_device *dev, void *data, } BUG_ON(!list_empty(&dev_priv...
71434f2fcba5c22d6e0d51878ba8e241a5dea5fb
Analyze and fix the following issue in the Linux kernel code: uprobes: Fix the racy uprobe->flags manipulation
Problem Details: Multiple threads can manipulate uprobe->flags, this is obviously unsafe. For example mmap can set UPROBE_COPY_INSN while register tries to set UPROBE_RUN_HANDLER, the latter can also race with can_skip_sstep() which clears UPROBE_SKIP_SSTEP. Change this code to use bitops. Signed-off-by: Oleg Nestero...
```diff diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 7f62b30c4172..c92651d619ca 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -79,11 +79,11 @@ static struct mutex uprobes_mmap_mutex[UPROBES_HASH_SZ]; static atomic_t uprobe_events = ATOMIC_INIT(0); /* Have a copy of or...
4710f05fd146d4739e57a8832a3abc5bd3bf0997
Analyze and fix the following issue in the Linux kernel code: uprobes: Fix prepare_uprobe() race with itself
Problem Details: install_breakpoint() is called under mm->mmap_sem, this protects set_swbp() but not prepare_uprobe(). Two or more different tasks can call install_breakpoint()->prepare_uprobe() at the same time, this leads to numerous problems if UPROBE_COPY_INSN is not set. Just for example, the second copy_insn() c...
```diff diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 4f315fa94c52..7f62b30c4172 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -89,6 +89,7 @@ struct uprobe { struct rb_node rb_node; /* node in the rb tree */ atomic_t ref; struct rw_semaphore consumer_rwsem; + struc...
142b18ddc81439acda4bc4231b291e99fe67d507
Analyze and fix the following issue in the Linux kernel code: uprobes: Fix handle_swbp() vs unregister() + register() race
Problem Details: Strictly speaking this race was added by me in 56bb4cf6. However I think that this bug is just another indication that we should move copy_insn/uprobe_analyze_insn code from install_breakpoint() to uprobe_register(), there are a lot of other reasons for that. Until then, add a hack to close the race. ...
```diff diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index a1b466d17c17..c718fef28617 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -596,6 +596,7 @@ install_breakpoint(struct uprobe *uprobe, struct mm_struct *mm, BUG_ON((uprobe->offset & ~PAGE_MASK) + UPROBE_SWBP_INSN_S...
695f0117e7d80709c7aec54d5fffb8051c97cf23
Analyze and fix the following issue in the Linux kernel code: ARM: OMAP: omap3evm: fix new sparse warning
Problem Details: Commit e54adb1e79762d3591459e5b0e9b9ff578e33fdb ("ARM: OMAP: omap3evm: cleanup revision bits") adds a new sparse[1] warning: arch/arm/mach-omap2/board-omap3evm.c:90:4: warning: symbol 'get_omap3_evm_rev' was not declared. Should it be static? This symbol no longer appears to be used outside this file...
```diff diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index c64e565bdef5..184ef21f6e3c 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -88,11 +88,10 @@ enum { static u8 omap3_evm_version; -u8 get_omap3_evm_rev(void) +static ...