mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 20:51:44 +00:00
USB: cxacru: fix an bounds check warning
This is a privileged operation so it doesn't matter much. We use "tmp" as an offset into an array. If it were invalid we could read out of bounds and trigger an oops if the memory is not mapped. Plus it makes static checkers complain. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1b83349fdd
commit
46e3cafb01
@ -476,6 +476,8 @@ static ssize_t cxacru_sysfs_store_adsl_config(struct device *dev,
|
||||
return -EINVAL;
|
||||
if (index < 0 || index > 0x7f)
|
||||
return -EINVAL;
|
||||
if (tmp < 0 || tmp > len - pos)
|
||||
return -EINVAL;
|
||||
pos += tmp;
|
||||
|
||||
/* skip trailing newline */
|
||||
|
Loading…
Reference in New Issue
Block a user