From 131a07f9150471bedaa8e8b239e0d347f11f86e1 Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Mon, 14 Jun 2010 11:46:25 +0200 Subject: [PATCH] --- yaml --- r: 206828 b: refs/heads/master c: bdfe273ee54b29498851fc8058516037d284270c h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/firewire/core-cdev.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index f0fc7bceb81e..6ae81f651238 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 33e553fe2b4a983ef34a57ab1440d8d33397bb12 +refs/heads/master: bdfe273ee54b29498851fc8058516037d284270c diff --git a/trunk/drivers/firewire/core-cdev.c b/trunk/drivers/firewire/core-cdev.c index 4e0478d70d4d..ce8cb6fcbbcd 100644 --- a/trunk/drivers/firewire/core-cdev.c +++ b/trunk/drivers/firewire/core-cdev.c @@ -864,10 +864,6 @@ static int ioctl_create_iso_context(struct client *client, union ioctl_arg *arg) struct fw_cdev_create_iso_context *a = &arg->create_iso_context; struct fw_iso_context *context; - /* We only support one context at this time. */ - if (client->iso_context != NULL) - return -EBUSY; - if (a->channel > 63) return -EINVAL; @@ -892,10 +888,17 @@ static int ioctl_create_iso_context(struct client *client, union ioctl_arg *arg) if (IS_ERR(context)) return PTR_ERR(context); + /* We only support one context at this time. */ + spin_lock_irq(&client->lock); + if (client->iso_context != NULL) { + spin_unlock_irq(&client->lock); + fw_iso_context_destroy(context); + return -EBUSY; + } client->iso_closure = a->closure; client->iso_context = context; + spin_unlock_irq(&client->lock); - /* We only support one context at this time. */ a->handle = 0; return 0;