Skip to content

Commit

Permalink
kernfs: add back missing error check in kernfs_fop_mmap()
Browse files Browse the repository at this point in the history
commit b44b214 upstream.

While updating how mmap enabled kernfs files are handled by lockdep,
9b2db6e ("sysfs: bail early from kernfs_file_mmap() to avoid
spurious lockdep warning") inadvertently dropped error return check
from kernfs_file_mmap().  The intention was just dropping "if
(ops->mmap)" check as the control won't reach the point if the mmap
callback isn't implemented, but I mistakenly removed the error return
check together with it.

This led to Xorg crash on i810 which was reported and bisected to the
commit and then to the specific change by Tobias.

Signed-off-by: Tejun Heo <[email protected]>
Reported-and-bisected-by: Tobias Powalowski <[email protected]>
Tested-by: Tobias Powalowski <[email protected]>
References: http://lkml.kernel.org/g/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
htejun authored and gregkh committed Jun 7, 2014
1 parent ce5e2b3 commit 59516f3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/kernfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,8 @@ static int kernfs_fop_mmap(struct file *file, struct vm_area_struct *vma)

ops = kernfs_ops(of->kn);
rc = ops->mmap(of, vma);
if (rc)
goto out_put;

/*
* PowerPC's pci_mmap of legacy_mem uses shmem_zero_setup()
Expand Down

0 comments on commit 59516f3

Please sign in to comment.