summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Patard (Rtp) <arnaud.patard@rtp-net.org>2010-08-23 23:02:22 +0200
committerJohn W. Linville <linville@tuxdriver.com>2010-08-25 14:34:56 -0400
commitf8d8b7a13d3d61f99bf3dc5c9650f87f9818d7a7 (patch)
tree2886d6df130230769ec1173915c9f518e7f883cb
parent8d1331b37d5b656a7a8e561f8e9d7661dd00c910 (diff)
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: Arnaud Patard <arnaud.patard@rtp-net.org> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00debug.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
index 74f0d679883..daf7f950a28 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
@@ -480,6 +480,9 @@ static ssize_t rt2x00debug_write_##__name(struct file *file, \
if (index >= debug->__name.word_count) \
return -EINVAL; \
\
+ if (length > sizeof(line)) \
+ return -EINVAL; \
+ \
if (copy_from_user(line, buf, length)) \
return -EFAULT; \
\