Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource: fix locking in find_next_iomem_res()
Since resources can be removed, locking should ensure that the resource is not removed while accessing it. However, find_next_iomem_res() does not hold the lock while copying the data of the resource. Keep holding the lock while the data is copied. While at it, change the return value to a more informative value. It is disregarded by the callers. [[email protected]: fix find_next_iomem_res() documentation] Link: http://lkml.kernel.org/r/[email protected] Fixes: ff3cc95 ("resource: Add remove_resource interface") Signed-off-by: Nadav Amit <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Reviewed-by: Dan Williams <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Toshi Kani <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information