diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-18 14:24:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-18 14:24:29 -0400 |
commit | eddeb0e2d863e3941d8768e70cb50c6120e61fa0 (patch) | |
tree | e30f2b6654e6eb397f9d7fb23a08d717cc19b12d /drivers/firewire/fw-cdev.c | |
parent | 855d854a33fca71cf68bad258bd5e66e5b265d10 (diff) | |
parent | db8be076cad4b843aa743ef462c75022cddd9c63 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: (43 commits)
firewire: cleanups
firewire: fix synchronization of gap counts
firewire: wait until PHY configuration packet was transmitted (fix bus reset loop)
firewire: remove unused struct member
firewire: use bitwise and to get reg in handle_registers
firewire: replace more hex values with defined csr constants
firewire: reread config ROM when device reset the bus
firewire: replace static ROM cache by allocated cache
firewire: fw-ohci: work around generation bug in TI controllers (fix AV/C and more)
firewire: fw-ohci: extend logging of bus generations and node ID
firewire: fw-ohci: conditionally log busReset interrupts
firewire: fw-ohci: don't append to AT context when it's not active
firewire: fw-ohci: log regAccessFail events
firewire: fw-ohci: make sure HCControl register LPS bit is set
firewire: fw-ohci: missing PPC PMac feature calls in failure path
firewire: fw-ohci: untangle a mixed unsigned/signed expression
firewire: debug interrupt events
firewire: fw-ohci: catch self_id_count == 0
firewire: fw-ohci: add self ID error check
firewire: fw-ohci: refactor probe, remove, suspend, resume
...
Diffstat (limited to 'drivers/firewire/fw-cdev.c')
-rw-r--r-- | drivers/firewire/fw-cdev.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c index 46bc197a047f..4a541921a14a 100644 --- a/drivers/firewire/fw-cdev.c +++ b/drivers/firewire/fw-cdev.c | |||
@@ -269,21 +269,28 @@ static int ioctl_get_info(struct client *client, void *buffer) | |||
269 | { | 269 | { |
270 | struct fw_cdev_get_info *get_info = buffer; | 270 | struct fw_cdev_get_info *get_info = buffer; |
271 | struct fw_cdev_event_bus_reset bus_reset; | 271 | struct fw_cdev_event_bus_reset bus_reset; |
272 | unsigned long ret = 0; | ||
272 | 273 | ||
273 | client->version = get_info->version; | 274 | client->version = get_info->version; |
274 | get_info->version = FW_CDEV_VERSION; | 275 | get_info->version = FW_CDEV_VERSION; |
275 | 276 | ||
277 | down_read(&fw_device_rwsem); | ||
278 | |||
276 | if (get_info->rom != 0) { | 279 | if (get_info->rom != 0) { |
277 | void __user *uptr = u64_to_uptr(get_info->rom); | 280 | void __user *uptr = u64_to_uptr(get_info->rom); |
278 | size_t want = get_info->rom_length; | 281 | size_t want = get_info->rom_length; |
279 | size_t have = client->device->config_rom_length * 4; | 282 | size_t have = client->device->config_rom_length * 4; |
280 | 283 | ||
281 | if (copy_to_user(uptr, client->device->config_rom, | 284 | ret = copy_to_user(uptr, client->device->config_rom, |
282 | min(want, have))) | 285 | min(want, have)); |
283 | return -EFAULT; | ||
284 | } | 286 | } |
285 | get_info->rom_length = client->device->config_rom_length * 4; | 287 | get_info->rom_length = client->device->config_rom_length * 4; |
286 | 288 | ||
289 | up_read(&fw_device_rwsem); | ||
290 | |||
291 | if (ret != 0) | ||
292 | return -EFAULT; | ||
293 | |||
287 | client->bus_reset_closure = get_info->bus_reset_closure; | 294 | client->bus_reset_closure = get_info->bus_reset_closure; |
288 | if (get_info->bus_reset != 0) { | 295 | if (get_info->bus_reset != 0) { |
289 | void __user *uptr = u64_to_uptr(get_info->bus_reset); | 296 | void __user *uptr = u64_to_uptr(get_info->bus_reset); |