IB/hfi1: Prevent NULL pointer dereference
authorMitko Haralanov <mitko.haralanov@intel.com>
Tue, 8 Mar 2016 19:14:31 +0000 (11:14 -0800)
committerDoug Ledford <dledford@redhat.com>
Mon, 21 Mar 2016 19:55:20 +0000 (15:55 -0400)
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>
drivers/staging/rdma/hfi1/mmu_rb.c

index 648f7e0a1d1716f758a1c28631500708969c6225..f42a33b55dc4f82acb747472cbb9f2328ff490ce 100644 (file)
@@ -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);
This page took 0.027607 seconds and 5 git commands to generate.