Files
linux-torvalds-mirror/include/linux
David Laight af4e9ef3d7 uaccess: Fix scoped_user_read_access() for 'pointer to const'
If a 'const struct foo __user *ptr' is used for the address passed to
scoped_user_read_access() then you get a warning/error

  uaccess.h:691:1: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]

for the

  void __user *_tmpptr = __scoped_user_access_begin(mode, uptr, size, elbl)

assignment.

Fix by using 'auto' for both _tmpptr and the redeclaration of uptr.
Replace the CLASS() with explicit __cleanup() functions on uptr.

Fixes: e497310b4f ("uaccess: Provide scoped user access regions")
Signed-off-by: David Laight <david.laight.linux@gmail.com>
Reviewed-and-tested-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-03-02 09:24:32 -08:00
..
2026-02-11 13:44:47 +01:00
2026-01-29 20:21:41 +01:00
2022-01-22 08:33:34 +02:00
2026-02-12 04:23:53 -07:00
2025-03-08 14:37:39 +01:00
2026-02-19 09:12:05 +01:00
2024-08-29 10:39:37 +02:00
2026-01-12 16:52:09 +01:00
2026-02-06 07:29:14 -07:00
2025-10-22 07:53:15 +02:00
2026-02-20 17:31:55 -05:00
2026-01-30 11:34:34 +00:00
2024-11-16 10:09:30 -06:00
2026-02-10 11:39:31 +01:00
2026-02-10 11:39:30 +01:00
2025-03-12 20:41:14 +01:00
2026-02-23 11:19:18 +01:00
2026-01-31 14:22:57 -08:00
2023-08-21 13:37:26 -07:00
2026-01-20 19:24:47 -08:00
2026-01-30 18:26:59 -08:00