diff options
Diffstat (limited to 'drivers/scsi/cxgbi/libcxgbi.c')
-rw-r--r-- | drivers/scsi/cxgbi/libcxgbi.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index d3ff9cd40234..e6e6aa9289b8 100644 --- a/drivers/scsi/cxgbi/libcxgbi.c +++ b/drivers/scsi/cxgbi/libcxgbi.c | |||
@@ -2148,11 +2148,10 @@ int cxgbi_set_conn_param(struct iscsi_cls_conn *cls_conn, | |||
2148 | enum iscsi_param param, char *buf, int buflen) | 2148 | enum iscsi_param param, char *buf, int buflen) |
2149 | { | 2149 | { |
2150 | struct iscsi_conn *conn = cls_conn->dd_data; | 2150 | struct iscsi_conn *conn = cls_conn->dd_data; |
2151 | struct iscsi_session *session = conn->session; | ||
2152 | struct iscsi_tcp_conn *tcp_conn = conn->dd_data; | 2151 | struct iscsi_tcp_conn *tcp_conn = conn->dd_data; |
2153 | struct cxgbi_conn *cconn = tcp_conn->dd_data; | 2152 | struct cxgbi_conn *cconn = tcp_conn->dd_data; |
2154 | struct cxgbi_sock *csk = cconn->cep->csk; | 2153 | struct cxgbi_sock *csk = cconn->cep->csk; |
2155 | int value, err = 0; | 2154 | int err; |
2156 | 2155 | ||
2157 | log_debug(1 << CXGBI_DBG_ISCSI, | 2156 | log_debug(1 << CXGBI_DBG_ISCSI, |
2158 | "cls_conn 0x%p, param %d, buf(%d) %s.\n", | 2157 | "cls_conn 0x%p, param %d, buf(%d) %s.\n", |
@@ -2174,15 +2173,7 @@ int cxgbi_set_conn_param(struct iscsi_cls_conn *cls_conn, | |||
2174 | conn->datadgst_en, 0); | 2173 | conn->datadgst_en, 0); |
2175 | break; | 2174 | break; |
2176 | case ISCSI_PARAM_MAX_R2T: | 2175 | case ISCSI_PARAM_MAX_R2T: |
2177 | sscanf(buf, "%d", &value); | 2176 | return iscsi_tcp_set_max_r2t(conn, buf); |
2178 | if (value <= 0 || !is_power_of_2(value)) | ||
2179 | return -EINVAL; | ||
2180 | if (session->max_r2t == value) | ||
2181 | break; | ||
2182 | iscsi_tcp_r2tpool_free(session); | ||
2183 | err = iscsi_set_param(cls_conn, param, buf, buflen); | ||
2184 | if (!err && iscsi_tcp_r2tpool_alloc(session)) | ||
2185 | return -ENOMEM; | ||
2186 | case ISCSI_PARAM_MAX_RECV_DLENGTH: | 2177 | case ISCSI_PARAM_MAX_RECV_DLENGTH: |
2187 | err = iscsi_set_param(cls_conn, param, buf, buflen); | 2178 | err = iscsi_set_param(cls_conn, param, buf, buflen); |
2188 | if (!err) | 2179 | if (!err) |