diff options
author | Sagi Grimberg <sagig@mellanox.com> | 2015-03-29 15:52:17 +0300 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-04-07 23:27:56 -0700 |
commit | 57df81e3b1bc7e65f48c2146ba1b3affbd709d5c (patch) | |
tree | bba9683ccaf3c794dc29f0d926c8e5fe459d6e42 | |
parent | c6b8e9180de76624d0a01148d6edd0107edebed1 (diff) |
iser-target: Remove redundant check on the device
In iser_connect_release there is no chance that
the iser device is set to NULL, if this happens
we have a BUG. So use BUG_ON.
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 97cee96dc035..357d4813b6c6 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 |