aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/ft1000
diff options
context:
space:
mode:
authorChen Gang <gang.chen.5i5j@gmail.com>2013-11-27 11:40:58 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-03 09:13:05 -0800
commit3229b869d14263c870ce0d3df18ce48fa02a40f2 (patch)
treefac86580de741a0a83ff54a8a0c0985d498c7be1 /drivers/staging/ft1000
parent358bd68cbdf23797f7360948094b4920caf65877 (diff)
downloadlinux-stericsson-3229b869d14263c870ce0d3df18ce48fa02a40f2.tar.gz
drivers: staging: ft1000: ft1000-usb: ft1000_debug.c: check return value of get_user() in ft1000_ioctl()
get_user() may fail and cause 'msgsz' uninitialized, so need give a check. The related warning (with allmodconfig under hexagon): CC [M] drivers/staging/ft1000/ft1000-usb/ft1000_debug.o drivers/staging/ft1000/ft1000-usb/ft1000_debug.c: In function 'ft1000_ioctl': include/uapi/linux/swab.h:53:9: warning: 'msgsz' may be used uninitialized in this function [-Wuninitialized] drivers/staging/ft1000/ft1000-usb/ft1000_debug.c:533:17: note: 'msgsz' was declared here Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ft1000')
-rw-r--r--drivers/staging/ft1000/ft1000-usb/ft1000_debug.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
index 68a55ce69200..ffdc7f597a96 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
@@ -560,6 +560,8 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
/* Get the length field to see how many bytes to copy */
result = get_user(msgsz, (__u16 __user *)argp);
+ if (result)
+ break;
msgsz = ntohs(msgsz);
/* DEBUG("FT1000:ft1000_ioctl: length of message = %d\n", msgsz); */