mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 21:51:40 +00:00
mac80211: check return value of rhashtable_init
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>
This commit is contained in:
parent
94513069eb
commit
111461d573
@ -60,7 +60,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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user