aboutsummaryrefslogtreecommitdiff
path: root/drivers/ieee1394/raw1394.c
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2008-11-19 15:54:50 +0000
committerBen Dooks <ben-linux@fluff.org>2008-11-19 15:54:50 +0000
commit0fc24c1ebff281406d66840cbaa6d303bc2cae24 (patch)
treeb3cacbb64fa31671d2f6241f38b5dd31db4a643a /drivers/ieee1394/raw1394.c
parentb9914406fb128bee01b2a23a35eafbc83ff915f0 (diff)
parent18aa04d882fe72eb59ea2c9e3f78400d85b6535f (diff)
Merge branch 'rmk-next' into s3c64xx
Diffstat (limited to 'drivers/ieee1394/raw1394.c')
-rw-r--r--drivers/ieee1394/raw1394.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c
index 9f19ac49210..bf7e761c12b 100644
--- a/drivers/ieee1394/raw1394.c
+++ b/drivers/ieee1394/raw1394.c
@@ -2268,7 +2268,8 @@ static ssize_t raw1394_write(struct file *file, const char __user * buffer,
return -EFAULT;
}
- mutex_lock(&fi->state_mutex);
+ if (!mutex_trylock(&fi->state_mutex))
+ return -EAGAIN;
switch (fi->state) {
case opened:
@@ -2548,7 +2549,8 @@ static int raw1394_mmap(struct file *file, struct vm_area_struct *vma)
struct file_info *fi = file->private_data;
int ret;
- mutex_lock(&fi->state_mutex);
+ if (!mutex_trylock(&fi->state_mutex))
+ return -EAGAIN;
if (fi->iso_state == RAW1394_ISO_INACTIVE)
ret = -EINVAL;
@@ -2669,7 +2671,8 @@ static long raw1394_ioctl(struct file *file, unsigned int cmd,
break;
}
- mutex_lock(&fi->state_mutex);
+ if (!mutex_trylock(&fi->state_mutex))
+ return -EAGAIN;
switch (fi->iso_state) {
case RAW1394_ISO_INACTIVE: