|
|
@@ -89,6 +89,12 @@ out:
|
|
|
return CHAP_DIGEST_UNKNOWN;
|
|
|
}
|
|
|
|
|
|
+static void chap_close(struct iscsi_conn *conn)
|
|
|
+{
|
|
|
+ kfree(conn->auth_protocol);
|
|
|
+ conn->auth_protocol = NULL;
|
|
|
+}
|
|
|
+
|
|
|
static struct iscsi_chap *chap_server_open(
|
|
|
struct iscsi_conn *conn,
|
|
|
struct iscsi_node_auth *auth,
|
|
|
@@ -126,7 +132,7 @@ static struct iscsi_chap *chap_server_open(
|
|
|
case CHAP_DIGEST_UNKNOWN:
|
|
|
default:
|
|
|
pr_err("Unsupported CHAP_A value\n");
|
|
|
- kfree(conn->auth_protocol);
|
|
|
+ chap_close(conn);
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
@@ -141,19 +147,13 @@ static struct iscsi_chap *chap_server_open(
|
|
|
* Generate Challenge.
|
|
|
*/
|
|
|
if (chap_gen_challenge(conn, 1, aic_str, aic_len) < 0) {
|
|
|
- kfree(conn->auth_protocol);
|
|
|
+ chap_close(conn);
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
return chap;
|
|
|
}
|
|
|
|
|
|
-static void chap_close(struct iscsi_conn *conn)
|
|
|
-{
|
|
|
- kfree(conn->auth_protocol);
|
|
|
- conn->auth_protocol = NULL;
|
|
|
-}
|
|
|
-
|
|
|
static int chap_server_compute_md5(
|
|
|
struct iscsi_conn *conn,
|
|
|
struct iscsi_node_auth *auth,
|