summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-05-25 20:24:28 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-05-25 20:24:28 -0700
commitbc2dbc5420e82560e650f8531ceca597441ca171 (patch)
treeac93448eaba1fe89fa007f9945f7e507b97dba8e /lib
parent03250e1028057173b212341015d5fbf53327042c (diff)
parent3f1959721558a976aaf9c2024d5bc884e6411bf7 (diff)
downloadlinux-0-day-bc2dbc5420e82560e650f8531ceca597441ca171.tar.gz
linux-0-day-bc2dbc5420e82560e650f8531ceca597441ca171.tar.xz
Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton: "16 fixes" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: kasan: fix memory hotplug during boot kasan: free allocated shadow memory on MEM_CANCEL_ONLINE checkpatch: fix macro argument precedence test init/main.c: include <linux/mem_encrypt.h> kernel/sys.c: fix potential Spectre v1 issue mm/memory_hotplug: fix leftover use of struct page during hotplug proc: fix smaps and meminfo alignment mm: do not warn on offline nodes unless the specific node is explicitly requested mm, memory_hotplug: make has_unmovable_pages more robust mm/kasan: don't vfree() nonexistent vm_area MAINTAINERS: change hugetlbfs maintainer and update files ipc/shm: fix shmat() nil address after round-down when remapping Revert "ipc/shm: Fix shmat mmap nil-page protection" idr: fix invalid ptr dereference on item delete ocfs2: revert "ocfs2/o2hb: check len for bio_add_page() to avoid getting incorrect bio" mm: fix nr_rotate_swap leak in swapon() error case
Diffstat (limited to 'lib')
-rw-r--r--lib/radix-tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index 43e0cbedc3a0c..a9e41aed6de4b 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -2034,10 +2034,12 @@ void *radix_tree_delete_item(struct radix_tree_root *root,
unsigned long index, void *item)
{
struct radix_tree_node *node = NULL;
- void __rcu **slot;
+ void __rcu **slot = NULL;
void *entry;
entry = __radix_tree_lookup(root, index, &node, &slot);
+ if (!slot)
+ return NULL;
if (!entry && (!is_idr(root) || node_tag_get(root, node, IDR_FREE,
get_slot_offset(node, slot))))
return NULL;