mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
IB/hfi1: Prevent NULL pointer dereference
Prevent a potential NULL pointer dereference (found by code inspection) when unregistering an MMU handler. Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Reviewed-by: Dean Luick <dean.luick@intel.com> Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com> Signed-off-by: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
c81e1f6452
commit
4b00d9490f
|
|
@ -107,6 +107,9 @@ void hfi1_mmu_rb_unregister(struct rb_root *root)
|
|||
struct mmu_rb_handler *handler = find_mmu_handler(root);
|
||||
unsigned long flags;
|
||||
|
||||
if (!handler)
|
||||
return;
|
||||
|
||||
spin_lock_irqsave(&mmu_rb_lock, flags);
|
||||
list_del(&handler->list);
|
||||
spin_unlock_irqrestore(&mmu_rb_lock, flags);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user