RDMA/nes: Remove redundant NULL check in nes_unregister_ofa_device()
authorRoland Dreier <rolandd@cisco.com>
Thu, 17 Apr 2008 04:01:09 +0000 (21:01 -0700)
committerRoland Dreier <rolandd@cisco.com>
Thu, 17 Apr 2008 04:01:09 +0000 (21:01 -0700)
nes_unregister_ofa_device() dereferences the nesibdev pointer before
testing if it's NULL.  Also, the test is doubly redundant because the
only caller of nes_unregister_ofa_device() is nes_destroy_ofa_device(),
which already tests if nesibdev is NULL.  Remove the unnecessary test.

This was spotted by the Coverity checker (CID 2190).

Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/nes/nes_verbs.c

index a651e9d9f0efdba6e38612b738f9455ccf2a1bcf..90fa06e4c9f40e4dfa3bee23e363288dec2d20f8 100644 (file)
@@ -3900,9 +3900,6 @@ void nes_unregister_ofa_device(struct nes_ib_device *nesibdev)
        struct nes_vnic *nesvnic = nesibdev->nesvnic;
        int i;
 
-       if (nesibdev == NULL)
-               return;
-
        for (i = 0; i < ARRAY_SIZE(nes_class_attributes); ++i) {
                class_device_remove_file(&nesibdev->ibdev.class_dev, nes_class_attributes[i]);
        }