Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165318
b: refs/heads/master
c: 094614f
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Richter committed Sep 12, 2009
1 parent 1fa98b3 commit 05a0ac0
Show file tree
Hide file tree
Showing 2 changed files with 8 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: 85cb9b68640cf467a99d4b6d518f1293222dbc9e
refs/heads/master: 094614fc14966bc6a6259ade55f051fe17f36122
13 changes: 7 additions & 6 deletions trunk/drivers/firewire/sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,19 +425,20 @@ static void sbp2_status_write(struct fw_card *card, struct fw_request *request,
struct sbp2_logical_unit *lu = callback_data;
struct sbp2_orb *orb;
struct sbp2_status status;
size_t header_size;
unsigned long flags;

if (tcode != TCODE_WRITE_BLOCK_REQUEST ||
length == 0 || length > sizeof(status)) {
length < 8 || length > sizeof(status)) {
fw_send_response(card, request, RCODE_TYPE_ERROR);
return;
}

header_size = min(length, 2 * sizeof(u32));
fw_memcpy_from_be32(&status, payload, header_size);
if (length > header_size)
memcpy(status.data, payload + 8, length - header_size);
status.status = be32_to_cpup(payload);
status.orb_low = be32_to_cpup(payload + 4);
memset(status.data, 0, sizeof(status.data));
if (length > 8)
memcpy(status.data, payload + 8, length - 8);

if (STATUS_GET_SOURCE(status) == 2 || STATUS_GET_SOURCE(status) == 3) {
fw_notify("non-orb related status write, not handled\n");
fw_send_response(card, request, RCODE_COMPLETE);
Expand Down

0 comments on commit 05a0ac0

Please sign in to comment.