Commit 5bd8341c authored by Roland Dreier's avatar Roland Dreier

RDMA/nes: Remove redundant NULL check in nes_unregister_ofa_device()

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: default avatarRoland Dreier <rolandd@cisco.com>
parent a7dab9e8
...@@ -3900,9 +3900,6 @@ void nes_unregister_ofa_device(struct nes_ib_device *nesibdev) ...@@ -3900,9 +3900,6 @@ void nes_unregister_ofa_device(struct nes_ib_device *nesibdev)
struct nes_vnic *nesvnic = nesibdev->nesvnic; struct nes_vnic *nesvnic = nesibdev->nesvnic;
int i; int i;
if (nesibdev == NULL)
return;
for (i = 0; i < ARRAY_SIZE(nes_class_attributes); ++i) { for (i = 0; i < ARRAY_SIZE(nes_class_attributes); ++i) {
class_device_remove_file(&nesibdev->ibdev.class_dev, nes_class_attributes[i]); class_device_remove_file(&nesibdev->ibdev.class_dev, nes_class_attributes[i]);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment