diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 97cee96dc035e6018622f8d9a3b13508718e185f..357d4813b6c6b32db269bbd08bc4a10474cbdc3e 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -797,7 +797,9 @@ isert_connect_release(struct isert_conn *isert_conn) isert_dbg("conn %p\n", isert_conn); - if (device && device->use_fastreg) + BUG_ON(!device); + + if (device->use_fastreg) isert_conn_free_fastreg_pool(isert_conn); isert_free_rx_descriptors(isert_conn); @@ -814,10 +816,9 @@ isert_connect_release(struct isert_conn *isert_conn) if (isert_conn->login_buf) isert_free_login_buf(isert_conn); - kfree(isert_conn); + isert_device_put(device); - if (device) - isert_device_put(device); + kfree(isert_conn); } static void