This bug was discovered by Smatch static checker ran by Dan Carpenter. If in free_rx_descriptors rx_descs are not NULL the iser device is definately not NULL as it was created before, so no need to check it before dereferencing it.
Signed-off-by: Sagi Grimberg <sa...@mellanox.com> Signed-off-by: Or Gerlitz <ogerl...@mellanox.com> --- drivers/infiniband/ulp/iser/iser_initiator.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c index bdc38f4..5f01da9 100644 --- a/drivers/infiniband/ulp/iser/iser_initiator.c +++ b/drivers/infiniband/ulp/iser/iser_initiator.c @@ -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; -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html