Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276473
b: refs/heads/master
c: 1c3d579
h: refs/heads/master
i:
  276471: 38112c3
v: v3
  • Loading branch information
Thomas Meyer authored and Nicholas Bellinger committed Dec 6, 2011
1 parent e3833d2 commit bfaf6c1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7ae0b1038f9f7d4c91e9afd4dbbc98210bf1a241
refs/heads/master: 1c3d5794fc4a2afd2258b3aa6406377934a36663
6 changes: 2 additions & 4 deletions trunk/drivers/target/iscsi/iscsi_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,13 +614,12 @@ int iscsit_add_reject(
hdr = (struct iscsi_reject *) cmd->pdu;
hdr->reason = reason;

cmd->buf_ptr = kzalloc(ISCSI_HDR_LEN, GFP_KERNEL);
cmd->buf_ptr = kmemdup(buf, ISCSI_HDR_LEN, GFP_KERNEL);
if (!cmd->buf_ptr) {
pr_err("Unable to allocate memory for cmd->buf_ptr\n");
iscsit_release_cmd(cmd);
return -1;
}
memcpy(cmd->buf_ptr, buf, ISCSI_HDR_LEN);

spin_lock_bh(&conn->cmd_lock);
list_add_tail(&cmd->i_list, &conn->conn_cmd_list);
Expand Down Expand Up @@ -661,13 +660,12 @@ int iscsit_add_reject_from_cmd(
hdr = (struct iscsi_reject *) cmd->pdu;
hdr->reason = reason;

cmd->buf_ptr = kzalloc(ISCSI_HDR_LEN, GFP_KERNEL);
cmd->buf_ptr = kmemdup(buf, ISCSI_HDR_LEN, GFP_KERNEL);
if (!cmd->buf_ptr) {
pr_err("Unable to allocate memory for cmd->buf_ptr\n");
iscsit_release_cmd(cmd);
return -1;
}
memcpy(cmd->buf_ptr, buf, ISCSI_HDR_LEN);

if (add_to_conn) {
spin_lock_bh(&conn->cmd_lock);
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/target/iscsi/iscsi_target_nego.c
Original file line number Diff line number Diff line change
Expand Up @@ -981,14 +981,13 @@ struct iscsi_login *iscsi_target_init_negotiation(
return NULL;
}

login->req = kzalloc(ISCSI_HDR_LEN, GFP_KERNEL);
login->req = kmemdup(login_pdu, ISCSI_HDR_LEN, GFP_KERNEL);
if (!login->req) {
pr_err("Unable to allocate memory for Login Request.\n");
iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR,
ISCSI_LOGIN_STATUS_NO_RESOURCES);
goto out;
}
memcpy(login->req, login_pdu, ISCSI_HDR_LEN);

login->req_buf = kzalloc(MAX_KEY_VALUE_PAIRS, GFP_KERNEL);
if (!login->req_buf) {
Expand Down

0 comments on commit bfaf6c1

Please sign in to comment.