Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292846
b: refs/heads/master
c: d335e60
h: refs/heads/master
v: v3
  • Loading branch information
Nicholas Bellinger committed Feb 25, 2012
1 parent 484cccb commit fc36e9d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 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: 33395fb8a13731c7ef7b175dbf5a4d8a6738fe6c
refs/heads/master: d335e6054db616bce3f040e659fa38440518ad1d
14 changes: 6 additions & 8 deletions trunk/drivers/target/iscsi/iscsi_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ static int iscsit_alloc_buffs(struct iscsi_cmd *cmd)
struct scatterlist *sgl;
u32 length = cmd->se_cmd.data_length;
int nents = DIV_ROUND_UP(length, PAGE_SIZE);
int i = 0, ret;
int i = 0, j = 0, ret;
/*
* If no SCSI payload is present, allocate the default iovecs used for
* iSCSI PDU Header
Expand Down Expand Up @@ -821,17 +821,15 @@ static int iscsit_alloc_buffs(struct iscsi_cmd *cmd)
*/
ret = iscsit_allocate_iovecs(cmd);
if (ret < 0)
goto page_alloc_failed;
return -ENOMEM;

return 0;

page_alloc_failed:
while (i >= 0) {
__free_page(sg_page(&sgl[i]));
i--;
}
kfree(cmd->t_mem_sg);
cmd->t_mem_sg = NULL;
while (j < i)
__free_page(sg_page(&sgl[j++]));

kfree(sgl);
return -ENOMEM;
}

Expand Down

0 comments on commit fc36e9d

Please sign in to comment.