I would just add a
case REREAD_BIB_CHANGED:
break;
to the switch to make that clear,
but otherwise
Signed-off-by: Kristian Høgsberg <krh@xxxxxxxxxx>
--- linux.orig/drivers/firewire/fw-cdev.c
+++ linux/drivers/firewire/fw-cdev.c
@@ -269,20 +270,25 @@ static int ioctl_get_info(struct client
{
struct fw_cdev_get_info *get_info = buffer;
struct fw_cdev_event_bus_reset bus_reset;
+ struct fw_device *device = client->device;
+ unsigned long ret = 0;
client->version = get_info->version;
get_info->version = FW_CDEV_VERSION;
+ down(&device->device.sem);
if (get_info->rom != 0) {
void __user *uptr = u64_to_uptr(get_info->rom);
size_t want = get_info->rom_length;
- size_t have = client->device->config_rom_length * 4;
+ size_t have;
- if (copy_to_user(uptr, client->device->config_rom,
- min(want, have)))
- return -EFAULT;
+ have = device->config_rom_length * 4;
+ ret = copy_to_user(uptr, device->config_rom, min(want, have));
}
- get_info->rom_length = client->device->config_rom_length * 4;
+ get_info->rom_length = device->config_rom_length * 4;
+ up(&device->device.sem);
+ if (ret != 0)
+ return -EFAULT;
client->bus_reset_closure = get_info->bus_reset_closure;
if (get_info->bus_reset != 0) {