Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118514
b: refs/heads/master
c: 8449fc3
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Richter committed Oct 31, 2008
1 parent eda5b7c commit 09c4946
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 638570b54346f140bc09b986d93e76025d35180f
refs/heads/master: 8449fc3ae58bf8ee5acbd2280754cde67b5db128
10 changes: 8 additions & 2 deletions trunk/drivers/ieee1394/dv1394.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 09c4946

Please sign in to comment.