mirror of
https://github.com/torvalds/linux.git
synced 2026-10-23 07:11:03 +02:00
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 <torvalds@linux-foundation.org>
This commit is contained in:
parent
198db29840
commit
d1280054f8
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user