diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/dma-buf.c | 3 | ||||
-rw-r--r-- | drivers/staging/omapdrm/omap_gem.c | 3 | ||||
-rw-r--r-- | drivers/tty/tty_io.c | 9 |
3 files changed, 5 insertions, 10 deletions
diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c index c30f3e1d0efc..460e22dee36d 100644 --- a/drivers/base/dma-buf.c +++ b/drivers/base/dma-buf.c | |||
@@ -460,8 +460,7 @@ int dma_buf_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma, | |||
460 | if (vma->vm_file) | 460 | if (vma->vm_file) |
461 | fput(vma->vm_file); | 461 | fput(vma->vm_file); |
462 | 462 | ||
463 | vma->vm_file = dmabuf->file; | 463 | vma->vm_file = get_file(dmabuf->file); |
464 | get_file(vma->vm_file); | ||
465 | 464 | ||
466 | vma->vm_pgoff = pgoff; | 465 | vma->vm_pgoff = pgoff; |
467 | 466 | ||
diff --git a/drivers/staging/omapdrm/omap_gem.c b/drivers/staging/omapdrm/omap_gem.c index 3a0d035a9e03..2a6bb7f9ee68 100644 --- a/drivers/staging/omapdrm/omap_gem.c +++ b/drivers/staging/omapdrm/omap_gem.c | |||
@@ -566,9 +566,8 @@ int omap_gem_mmap_obj(struct drm_gem_object *obj, | |||
566 | * in particular in the case of mmap'd dmabufs) | 566 | * in particular in the case of mmap'd dmabufs) |
567 | */ | 567 | */ |
568 | fput(vma->vm_file); | 568 | fput(vma->vm_file); |
569 | get_file(obj->filp); | ||
570 | vma->vm_pgoff = 0; | 569 | vma->vm_pgoff = 0; |
571 | vma->vm_file = obj->filp; | 570 | vma->vm_file = get_file(obj->filp); |
572 | 571 | ||
573 | vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); | 572 | vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); |
574 | } | 573 | } |
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 71d95cfbabec..c7561f29d894 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
@@ -1163,10 +1163,8 @@ ssize_t redirected_tty_write(struct file *file, const char __user *buf, | |||
1163 | struct file *p = NULL; | 1163 | struct file *p = NULL; |
1164 | 1164 | ||
1165 | spin_lock(&redirect_lock); | 1165 | spin_lock(&redirect_lock); |
1166 | if (redirect) { | 1166 | if (redirect) |
1167 | get_file(redirect); | 1167 | p = get_file(redirect); |
1168 | p = redirect; | ||
1169 | } | ||
1170 | spin_unlock(&redirect_lock); | 1168 | spin_unlock(&redirect_lock); |
1171 | 1169 | ||
1172 | if (p) { | 1170 | if (p) { |
@@ -2246,8 +2244,7 @@ static int tioccons(struct file *file) | |||
2246 | spin_unlock(&redirect_lock); | 2244 | spin_unlock(&redirect_lock); |
2247 | return -EBUSY; | 2245 | return -EBUSY; |
2248 | } | 2246 | } |
2249 | get_file(file); | 2247 | redirect = get_file(file); |
2250 | redirect = file; | ||
2251 | spin_unlock(&redirect_lock); | 2248 | spin_unlock(&redirect_lock); |
2252 | return 0; | 2249 | return 0; |
2253 | } | 2250 | } |