Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302400
b: refs/heads/master
c: 381e309
h: refs/heads/master
v: v3
  • Loading branch information
Dan Carpenter authored and Nicholas Bellinger committed May 6, 2012
1 parent 90ee5a0 commit 0cde04c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 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: bfb79eac2026b411df9e253a9c350039b4b04bb7
refs/heads/master: 381e309a658feadb48c14566b3b26ccb7eec75a0
20 changes: 10 additions & 10 deletions trunk/drivers/target/iscsi/iscsi_target_seq_pdu_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ static int iscsit_randomize_pdu_lists(
seq_count++;
continue;
}
array = kzalloc(seq_count * sizeof(u32), GFP_KERNEL);
array = kcalloc(seq_count, sizeof(u32), GFP_KERNEL);
if (!array) {
pr_err("Unable to allocate memory"
" for random array.\n");
return -1;
return -ENOMEM;
}
iscsit_create_random_array(array, seq_count);

Expand All @@ -161,11 +161,11 @@ static int iscsit_randomize_pdu_lists(
}

if (seq_count) {
array = kzalloc(seq_count * sizeof(u32), GFP_KERNEL);
array = kcalloc(seq_count, sizeof(u32), GFP_KERNEL);
if (!array) {
pr_err("Unable to allocate memory for"
" random array.\n");
return -1;
return -ENOMEM;
}
iscsit_create_random_array(array, seq_count);

Expand Down Expand Up @@ -193,10 +193,10 @@ static int iscsit_randomize_seq_lists(
if (!seq_count)
return 0;

array = kzalloc(seq_count * sizeof(u32), GFP_KERNEL);
array = kcalloc(seq_count, sizeof(u32), GFP_KERNEL);
if (!array) {
pr_err("Unable to allocate memory for random array.\n");
return -1;
return -ENOMEM;
}
iscsit_create_random_array(array, seq_count);

Expand Down Expand Up @@ -546,21 +546,21 @@ int iscsit_build_pdu_and_seq_lists(
iscsit_determine_counts_for_list(cmd, &bl, &seq_count, &pdu_count);

if (!conn->sess->sess_ops->DataSequenceInOrder) {
seq = kzalloc(seq_count * sizeof(struct iscsi_seq), GFP_ATOMIC);
seq = kcalloc(seq_count, sizeof(struct iscsi_seq), GFP_ATOMIC);
if (!seq) {
pr_err("Unable to allocate struct iscsi_seq list\n");
return -1;
return -ENOMEM;
}
cmd->seq_list = seq;
cmd->seq_count = seq_count;
}

if (!conn->sess->sess_ops->DataPDUInOrder) {
pdu = kzalloc(pdu_count * sizeof(struct iscsi_pdu), GFP_ATOMIC);
pdu = kcalloc(pdu_count, sizeof(struct iscsi_pdu), GFP_ATOMIC);
if (!pdu) {
pr_err("Unable to allocate struct iscsi_pdu list.\n");
kfree(seq);
return -1;
return -ENOMEM;
}
cmd->pdu_list = pdu;
cmd->pdu_count = pdu_count;
Expand Down

0 comments on commit 0cde04c

Please sign in to comment.