Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98342
b: refs/heads/master
c: 5cb8406
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Richter committed Jun 18, 2008
1 parent 2ca9a03 commit c6d0937
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 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: affc9c24ade666f9903163c12686da567dbfe06f
refs/heads/master: 5cb84067d646fa3889463129dad8b218806b4698
9 changes: 7 additions & 2 deletions trunk/drivers/firewire/fw-cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ fw_device_op_read(struct file *file,
return dequeue_event(client, buffer, count);
}

/* caller must hold card->lock so that node pointers can be dereferenced here */
static void
fill_bus_reset_event(struct fw_cdev_event_bus_reset *event,
struct client *client)
Expand All @@ -214,7 +215,6 @@ fill_bus_reset_event(struct fw_cdev_event_bus_reset *event,
event->closure = client->bus_reset_closure;
event->type = FW_CDEV_EVENT_BUS_RESET;
event->generation = client->device->generation;
smp_rmb(); /* node_id must not be older than generation */
event->node_id = client->device->node_id;
event->local_node_id = card->local_node->node_id;
event->bm_node_id = 0; /* FIXME: We don't track the BM. */
Expand Down Expand Up @@ -274,6 +274,7 @@ static int ioctl_get_info(struct client *client, void *buffer)
{
struct fw_cdev_get_info *get_info = buffer;
struct fw_cdev_event_bus_reset bus_reset;
struct fw_card *card = client->device->card;
unsigned long ret = 0;

client->version = get_info->version;
Expand All @@ -299,13 +300,17 @@ static int ioctl_get_info(struct client *client, void *buffer)
client->bus_reset_closure = get_info->bus_reset_closure;
if (get_info->bus_reset != 0) {
void __user *uptr = u64_to_uptr(get_info->bus_reset);
unsigned long flags;

spin_lock_irqsave(&card->lock, flags);
fill_bus_reset_event(&bus_reset, client);
spin_unlock_irqrestore(&card->lock, flags);

if (copy_to_user(uptr, &bus_reset, sizeof(bus_reset)))
return -EFAULT;
}

get_info->card = client->device->card->index;
get_info->card = card->index;

return 0;
}
Expand Down

0 comments on commit c6d0937

Please sign in to comment.