diff options
-rw-r--r-- | drivers/firewire/core-cdev.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 4e0478d70d4d..ce8cb6fcbbcd 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c | |||
@@ -864,10 +864,6 @@ static int ioctl_create_iso_context(struct client *client, union ioctl_arg *arg) | |||
864 | struct fw_cdev_create_iso_context *a = &arg->create_iso_context; | 864 | struct fw_cdev_create_iso_context *a = &arg->create_iso_context; |
865 | struct fw_iso_context *context; | 865 | struct fw_iso_context *context; |
866 | 866 | ||
867 | /* We only support one context at this time. */ | ||
868 | if (client->iso_context != NULL) | ||
869 | return -EBUSY; | ||
870 | |||
871 | if (a->channel > 63) | 867 | if (a->channel > 63) |
872 | return -EINVAL; | 868 | return -EINVAL; |
873 | 869 | ||
@@ -892,10 +888,17 @@ static int ioctl_create_iso_context(struct client *client, union ioctl_arg *arg) | |||
892 | if (IS_ERR(context)) | 888 | if (IS_ERR(context)) |
893 | return PTR_ERR(context); | 889 | return PTR_ERR(context); |
894 | 890 | ||
891 | /* We only support one context at this time. */ | ||
892 | spin_lock_irq(&client->lock); | ||
893 | if (client->iso_context != NULL) { | ||
894 | spin_unlock_irq(&client->lock); | ||
895 | fw_iso_context_destroy(context); | ||
896 | return -EBUSY; | ||
897 | } | ||
895 | client->iso_closure = a->closure; | 898 | client->iso_closure = a->closure; |
896 | client->iso_context = context; | 899 | client->iso_context = context; |
900 | spin_unlock_irq(&client->lock); | ||
897 | 901 | ||
898 | /* We only support one context at this time. */ | ||
899 | a->handle = 0; | 902 | a->handle = 0; |
900 | 903 | ||
901 | return 0; | 904 | return 0; |