提交 24190364 编写于 作者: D Dan Carpenter 提交者: Greg Kroah-Hartman

dsp56k: prevent a harmless underflow

There is a mistake here where we don't allow "len" to be zero but we
allow negative lengths.  It's basically harmless in this case, but the
underflow makes my static checker complain.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NArnd Bergmann <arnd@arndb.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 077e2642
......@@ -325,7 +325,7 @@ static long dsp56k_ioctl(struct file *file, unsigned int cmd,
if(get_user(bin, &binary->bin) < 0)
return -EFAULT;
if (len == 0) {
if (len <= 0) {
return -EINVAL; /* nothing to upload?!? */
}
if (len > DSP56K_MAX_BINARY_LENGTH) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册