Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8d8b7a1 authored by Arnaud Patard's avatar Arnaud Patard Committed by John W. Linville
Browse files

rt2x00: fix "buffer size not provably correct" build warning



rt2x00 debugfs interface doesn't check the size of the data coming
from userspace, leading to a build warning. Fix That.

v2: return EINVAL if input is too long

Signed-off-by: default avatarArnaud Patard <arnaud.patard@rtp-net.org>
Acked-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8d1331b3
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -480,6 +480,9 @@ static ssize_t rt2x00debug_write_##__name(struct file *file, \
	if (index >= debug->__name.word_count)			\
	if (index >= debug->__name.word_count)			\
		return -EINVAL;					\
		return -EINVAL;					\
								\
								\
	if (length > sizeof(line))				\
		return -EINVAL;					\
								\
	if (copy_from_user(line, buf, length))			\
	if (copy_from_user(line, buf, length))			\
		return -EFAULT;					\
		return -EFAULT;					\
								\
								\