Merge "mm: swap: Add null pointer check"

This commit is contained in:
qctecmdr 2020-01-11 22:50:47 -08:00 • committed by Gerrit - the friendly Code Review server
commit 57d8056ef9

View file

@ -282,7 +282,7 @@ int free_swap_slot(swp_entry_t entry)
si = swp_swap_info(entry);
cache = raw_cpu_ptr(&swp_slots);
if (!(si->flags & SWP_SYNCHRONOUS_IO) &&
if ((si && !(si->flags & SWP_SYNCHRONOUS_IO)) &&
use_swap_slot_cache && cache->slots_ret) {
spin_lock_irq(&cache->free_lock);
/* Swap slots cache may be deactivated before acquiring lock */