Skip to content

Commit 735de5c

Browse files
author
Hans Verkuil
committed
media: vb2: frame_vector.c: replace WARN_ONCE with a comment
The WARN_ONCE was issued also in cases that had nothing to do with VM_IO (e.g. if the start address was just a random value and uaccess fails with -EFAULT). There are no reports of WARN_ONCE being issued for actual VM_IO cases, so just drop it and instead add a note to the comment before the function. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: David Hildenbrand <david@redhat.com> Reported-by: Yikebaer Aizezi <yikebaer61@gmail.com>
1 parent 41ebaa5 commit 735de5c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/media/common/videobuf2/frame_vector.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
* different type underlying the specified range of virtual addresses.
3232
* When the function isn't able to map a single page, it returns error.
3333
*
34+
* Note that get_vaddr_frames() cannot follow VM_IO mappings. It used
35+
* to be able to do that, but that could (racily) return non-refcounted
36+
* pfns.
37+
*
3438
* This function takes care of grabbing mmap_lock as necessary.
3539
*/
3640
int get_vaddr_frames(unsigned long start, unsigned int nr_frames, bool write,
@@ -59,8 +63,6 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames, bool write,
5963
if (likely(ret > 0))
6064
return ret;
6165

62-
/* This used to (racily) return non-refcounted pfns. Let people know */
63-
WARN_ONCE(1, "get_vaddr_frames() cannot follow VM_IO mapping");
6466
vec->nr_frames = 0;
6567
return ret ? ret : -EFAULT;
6668
}

0 commit comments

Comments
 (0)