]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
radix-tree: must check __radix_tree_preload() return value
authorEric Dumazet <edumazet@google.com>
Fri, 8 Sep 2017 23:15:54 +0000 (16:15 -0700)
committerSeth Forshee <seth.forshee@canonical.com>
Fri, 15 Sep 2017 16:15:08 +0000 (09:15 -0700)
commit27cc5aaae1a980d98fc945a7a9d1807c7270da3d
tree7d4c87beb8570b97ead051ab18d124552416ca24
parent6addfabb4595bc1e4a38e8de8a8adaef46f20b3e
radix-tree: must check __radix_tree_preload() return value

BugLink: http://bugs.launchpad.net/bugs/1717549
commit bc9ae2247ac92fd4d962507bafa3afffff6660ff upstream.

__radix_tree_preload() only disables preemption if no error is returned.

So we really need to make sure callers always check the return value.

idr_preload() contract is to always disable preemption, so we need
to add a missing preempt_disable() if an error happened.

Similarly, ida_pre_get() only needs to call preempt_enable() in the
case no error happened.

Link: http://lkml.kernel.org/r/1504637190.15310.62.camel@edumazet-glaptop3.roam.corp.google.com
Fixes: 0a835c4f090a ("Reimplement IDR and IDA using the radix tree")
Fixes: 7ad3d4d85c7a ("ida: Move ida_bitmap to a percpu variable")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
lib/radix-tree.c