diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-11-10 10:16:17 +0000 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2008-11-10 10:16:17 +0000 |
commit | d79aab2852cd89ed8b792d633c9bebc0c6af74ac (patch) | |
tree | 029dec967090ff96578df1fcf70d358a34c2dc3e /drivers/ieee1394/dv1394.c | |
parent | 039d35267d79b9feae3a850f54b2677dea019f0a (diff) | |
parent | f7160c7573615ec82c691e294cf80d920b5d588d (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into rmk-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); |