isert-scst: Fail login if max_sge is too small

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9090 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2020-08-02 21:21:38 +00:00
parent ecea60a694
commit 1b5e2eb482

View File

@@ -1302,7 +1302,10 @@ static struct isert_connection *isert_conn_create(struct rdma_cm_id *cm_id,
isert_conn->max_sge = isert_dev->device_attr.max_recv_sge - 3;
#endif
WARN_ON(isert_conn->max_sge < 1);
if (WARN_ON(isert_conn->max_sge < 1)) {
err = -ENODEV;
goto fail_login_req_pdu;
}
INIT_LIST_HEAD(&isert_conn->rx_buf_list);
INIT_LIST_HEAD(&isert_conn->tx_free_list);