Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264702
b: refs/heads/master
c: 0c2cfe5
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Nicholas Bellinger committed Oct 24, 2011
1 parent 00c1bfd commit 4439ee9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 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: b7b8bef7f8c1c9b3358127608e867db7cd928022
refs/heads/master: 0c2cfe5fe78e682d6235a1d32a363460b1c77528
13 changes: 8 additions & 5 deletions trunk/drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -3585,23 +3585,26 @@ static void transport_free_dev_tasks(struct se_cmd *cmd)
{
struct se_task *task, *task_tmp;
unsigned long flags;
LIST_HEAD(dispose_list);

spin_lock_irqsave(&cmd->t_state_lock, flags);
list_for_each_entry_safe(task, task_tmp,
&cmd->t_task_list, t_list) {
if (task->task_flags & TF_ACTIVE)
continue;
if (!(task->task_flags & TF_ACTIVE))
list_move_tail(&task->t_list, &dispose_list);
}
spin_unlock_irqrestore(&cmd->t_state_lock, flags);

while (!list_empty(&dispose_list)) {
task = list_first_entry(&dispose_list, struct se_task, t_list);

kfree(task->task_sg_bidi);
kfree(task->task_sg);

list_del(&task->t_list);

spin_unlock_irqrestore(&cmd->t_state_lock, flags);
cmd->se_dev->transport->free_task(task);
spin_lock_irqsave(&cmd->t_state_lock, flags);
}
spin_unlock_irqrestore(&cmd->t_state_lock, flags);
}

static inline void transport_free_sgl(struct scatterlist *sgl, int nents)
Expand Down

0 comments on commit 4439ee9

Please sign in to comment.