Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210147
b: refs/heads/master
c: 6c74340
h: refs/heads/master
i:
  210145: c233c27
  210143: 4f39a8b
v: v3
  • Loading branch information
Stefan Richter committed Aug 19, 2010
1 parent bb954d7 commit a157d2d
Show file tree
Hide file tree
Showing 2 changed files with 8 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: 840fe6359c1db978d01fceb8a023f5f6efdf7f1c
refs/heads/master: 6c74340bce253ea95c9ee801b3c411a333937edf
12 changes: 7 additions & 5 deletions trunk/drivers/firewire/sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ static void sbp2_status_write(struct fw_card *card, struct fw_request *request,

if (&orb->link != &lu->orb_list) {
orb->callback(orb, &status);
kref_put(&orb->kref, free_orb);
kref_put(&orb->kref, free_orb); /* orb callback reference */
} else {
fw_error("status write for unknown orb\n");
}
Expand Down Expand Up @@ -480,12 +480,14 @@ static void complete_transaction(struct fw_card *card, int rcode,
if (orb->rcode != RCODE_COMPLETE) {
list_del(&orb->link);
spin_unlock_irqrestore(&card->lock, flags);

orb->callback(orb, NULL);
kref_put(&orb->kref, free_orb); /* orb callback reference */
} else {
spin_unlock_irqrestore(&card->lock, flags);
}

kref_put(&orb->kref, free_orb);
kref_put(&orb->kref, free_orb); /* transaction callback reference */
}

static void sbp2_send_orb(struct sbp2_orb *orb, struct sbp2_logical_unit *lu,
Expand All @@ -501,9 +503,8 @@ static void sbp2_send_orb(struct sbp2_orb *orb, struct sbp2_logical_unit *lu,
list_add_tail(&orb->link, &lu->orb_list);
spin_unlock_irqrestore(&device->card->lock, flags);

/* Take a ref for the orb list and for the transaction callback. */
kref_get(&orb->kref);
kref_get(&orb->kref);
kref_get(&orb->kref); /* transaction callback reference */
kref_get(&orb->kref); /* orb callback reference */

fw_send_request(device->card, &orb->t, TCODE_WRITE_BLOCK_REQUEST,
node_id, generation, device->max_speed, offset,
Expand All @@ -530,6 +531,7 @@ static int sbp2_cancel_orbs(struct sbp2_logical_unit *lu)

orb->rcode = RCODE_CANCELLED;
orb->callback(orb, NULL);
kref_put(&orb->kref, free_orb); /* orb callback reference */
}

return retval;
Expand Down

0 comments on commit a157d2d

Please sign in to comment.