From d1280054f8374cedc1d3b2fac44eb060f81cba50 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Mon, 19 Oct 2026 19:24:01 -1000 Subject: [PATCH] PNP: isapnp: use put_user() in the proc read loop isapnp_proc_bus_read() checks the user buffer with access_ok() and then copies the configuration registers one byte at a time with __put_user(), reading each register in between. Each of those accesses enables and disables user access on its own, so the up-front check saves nothing. Use put_user(). The ignored return value and the access_ok() stay as they were. This is part of getting rid of __get_user() and __put_user() entirely. Signed-off-by: Linus Torvalds --- drivers/pnp/isapnp/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c index 55ae72a2818b..c1f6e6bd0eb2 100644 --- a/drivers/pnp/isapnp/proc.c +++ b/drivers/pnp/isapnp/proc.c @@ -41,7 +41,7 @@ static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf, for (; pos < 256 && cnt > 0; pos++, buf++, cnt--) { unsigned char val; val = isapnp_read_byte(pos); - __put_user(val, buf); + put_user(val, buf); } isapnp_cfg_end();