Skip to content

Commit

Permalink
IB/iser: Fix redundant pointer check in dealloc flow
Browse files Browse the repository at this point in the history
This bug was discovered by Smatch static checker run by Dan Carpenter.
If in free_rx_descriptors(), rx_descs are not NULL then the iser
device is definately not NULL, so no need to check it before
dereferencing it.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
  • Loading branch information
Sagi Grimberg authored and Roland Dreier committed Sep 3, 2013
1 parent 27ae2d1 commit 2e02d65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/ulp/iser/iser_initiator.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ void iser_free_rx_descriptors(struct iser_conn *ib_conn)
if (!ib_conn->rx_descs)
goto free_login_buf;

if (device && device->iser_free_rdma_reg_res)
if (device->iser_free_rdma_reg_res)
device->iser_free_rdma_reg_res(ib_conn);

rx_desc = ib_conn->rx_descs;
Expand Down

0 comments on commit 2e02d65

Please sign in to comment.