diff options
author | Paul Mackerras <paulus@samba.org> | 2008-11-12 08:43:22 +1100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-11-12 08:43:22 +1100 |
commit | 486936cd93e99c802153b3f2f629c5ce62b8c0d4 (patch) | |
tree | 51e261a96e1fb6b51d4a6afb92bfc2480e150b6c /drivers/ieee1394/dv1394.c | |
parent | 1c1b777a5673b57a6c0377ba60a790d05e4a0676 (diff) | |
parent | f21f237cf55494c3a4209de323281a3b0528da10 (diff) |
Merge branch 'linux-2.6' into next
Diffstat (limited to 'drivers/ieee1394/dv1394.c')
-rw-r--r-- | drivers/ieee1394/dv1394.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c index 965cfdb84eb..c19f2326715 100644 --- a/drivers/ieee1394/dv1394.c +++ b/drivers/ieee1394/dv1394.c @@ -1270,8 +1270,14 @@ static int dv1394_mmap(struct file *file, struct vm_area_struct *vma) struct video_card *video = file_to_video_card(file); int retval = -EINVAL; - /* serialize mmap */ - mutex_lock(&video->mtx); + /* + * We cannot use the blocking variant mutex_lock here because .mmap + * is called with mmap_sem held, while .ioctl, .read, .write acquire + * video->mtx and subsequently call copy_to/from_user which will + * grab mmap_sem in case of a page fault. + */ + if (!mutex_trylock(&video->mtx)) + return -EAGAIN; if ( ! video_card_initialized(video) ) { retval = do_dv1394_init_default(video); |