aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/isert/ib_isert.c
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2015-03-29 08:52:17 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2015-04-08 02:27:56 -0400
commit57df81e3b1bc7e65f48c2146ba1b3affbd709d5c (patch)
treebba9683ccaf3c794dc29f0d926c8e5fe459d6e42 /drivers/infiniband/ulp/isert/ib_isert.c
parentc6b8e9180de76624d0a01148d6edd0107edebed1 (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>
Diffstat (limited to 'drivers/infiniband/ulp/isert/ib_isert.c')
-rw-r--r--drivers/infiniband/ulp/isert/ib_isert.c9
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)
797 797
798 isert_dbg("conn %p\n", isert_conn); 798 isert_dbg("conn %p\n", isert_conn);
799 799
800 if (device && device->use_fastreg) 800 BUG_ON(!device);
801
802 if (device->use_fastreg)
801 isert_conn_free_fastreg_pool(isert_conn); 803 isert_conn_free_fastreg_pool(isert_conn);
802 804
803 isert_free_rx_descriptors(isert_conn); 805 isert_free_rx_descriptors(isert_conn);
@@ -814,10 +816,9 @@ isert_connect_release(struct isert_conn *isert_conn)
814 if (isert_conn->login_buf) 816 if (isert_conn->login_buf)
815 isert_free_login_buf(isert_conn); 817 isert_free_login_buf(isert_conn);
816 818
817 kfree(isert_conn); 819 isert_device_put(device);
818 820
819 if (device) 821 kfree(isert_conn);
820 isert_device_put(device);
821} 822}
822 823
823static void 824static void