From: Sagi Grimberg Date: Tue, 10 Jun 2014 10:41:41 +0000 (+0300) Subject: Target/iser: Fix a wrong dereference in case discovery session is over iser X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e0546fc1ba66c90cb38a5764357366267d3e58e4;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Target/iser: Fix a wrong dereference in case discovery session is over iser In case the discovery session is carried over iser, we can't access the assumed network portal since the default portal is used. In this case we don't really need to allocate the fastreg pool, just prepare to the text pdu that will follow. Signed-off-by: Sagi Grimberg Reported-by: Alex Tabachnik Cc: stable@vger.kernel.org # 3.15+ Signed-off-by: Nicholas Bellinger --- diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index b622783ab198..647a5e2beee4 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -1053,7 +1053,9 @@ isert_put_login_tx(struct iscsi_conn *conn, struct iscsi_login *login, } if (!login->login_failed) { if (login->login_complete) { - if (isert_conn->conn_device->use_fastreg) { + if (!conn->sess->sess_ops->SessionType && + isert_conn->conn_device->use_fastreg) { + /* Normal Session and fastreg is used */ u8 pi_support = login->np->tpg_np->tpg->tpg_attrib.t10_pi; ret = isert_conn_create_fastreg_pool(isert_conn,