aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/mmap_lock.h
diff options
context:
space:
mode:
authorLorenzo Stoakes <lstoakes@gmail.com>2023-03-22 20:18:59 +0000
committerAndrew Morton <akpm@linux-foundation.org>2023-04-05 19:42:58 -0700
commitb0729ae0ae67a1a001e8d577b8be9ba44c4bdb26 (patch)
treed05ba6e79dbbd4571cfbf104b0ce5e51ecae9394 /include/linux/mmap_lock.h
parentmm/mmap/vma_merge: fold curr, next assignment logic (diff)
downloadwireguard-linux-b0729ae0ae67a1a001e8d577b8be9ba44c4bdb26.tar.xz
wireguard-linux-b0729ae0ae67a1a001e8d577b8be9ba44c4bdb26.zip
mm/mmap/vma_merge: explicitly assign res, vma, extend invariants
Previously, vma was an uninitialised variable which was only definitely assigned as a result of the logic covering all possible input cases - for it to have remained uninitialised, prev would have to be NULL, and next would _have_ to be mergeable. The value of res defaults to NULL, so we can neatly eliminate the assignment to res and vma in the if (prev) block and ensure that both res and vma are both explicitly assigned, by just setting both to prev. In addition we add an explanation as to under what circumstances both might change, and since we absolutely do rely on addr == curr->vm_start should curr exist, assert that this is the case. Link: https://lkml.kernel.org/r/83938bed24422cbe5954bbf491341674becfe567.1679516210.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com> Reviewed-by: Vlastimil Babka <vbabka@suse.cz> Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com> Cc: David Hildenbrand <david@redhat.com> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Vernon Yang <vernon2gm@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/mmap_lock.h')
0 files changed, 0 insertions, 0 deletions