提交 4b00d949 编写于 作者: M Mitko Haralanov 提交者: Doug Ledford

IB/hfi1: Prevent NULL pointer dereference

Prevent a potential NULL pointer dereference (found
by code inspection) when unregistering an MMU handler.
Reviewed-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: NDean Luick <dean.luick@intel.com>
Signed-off-by: NMitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: NJubin John <jubin.john@intel.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 c81e1f64
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册