projects
/
wrapfs-3.14.y.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
65492b0
)
mac80211: check return value of rhashtable_init
author
MichelleJin
<shjy180909@gmail.com>
Mon, 27 Sep 2021 03:34:57 +0000
(
03:34
+0000)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Sun, 17 Oct 2021 08:19:49 +0000
(10:19 +0200)
[ Upstream commit
111461d573741c17eafad029ac93474fa9adcce0
]
When rhashtable_init() fails, it returns -EINVAL.
However, since error return value of rhashtable_init is not checked,
it can cause use of uninitialized pointers.
So, fix unhandled errors of rhashtable_init.
Signed-off-by: MichelleJin <shjy180909@gmail.com>
Link:
https://lore.kernel.org/r/20210927033457.1020967-4-shjy180909@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/mac80211/mesh_pathtbl.c
patch
|
blob
|
history
diff --git
a/net/mac80211/mesh_pathtbl.c
b/net/mac80211/mesh_pathtbl.c
index 6dc5f93b1e4d12a4ccaf639add161574ddf2d1d5..06b44c3c831adde063f613f5710d4cce0f492d60 100644
(file)
--- a/
net/mac80211/mesh_pathtbl.c
+++ b/
net/mac80211/mesh_pathtbl.c
@@
-63,7
+63,10
@@
static struct mesh_table *mesh_table_alloc(void)
atomic_set(&newtbl->entries, 0);
spin_lock_init(&newtbl->gates_lock);
spin_lock_init(&newtbl->walk_lock);
- rhashtable_init(&newtbl->rhead, &mesh_rht_params);
+ if (rhashtable_init(&newtbl->rhead, &mesh_rht_params)) {
+ kfree(newtbl);
+ return NULL;
+ }
return newtbl;
}