diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-02-08 10:18:08 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-09 13:10:20 +0100 |
commit | cd47e4d69abfd5a3e85ba4ff282db5acfffd6fc2 (patch) | |
tree | b48d3313c50fc01c8d442bbba75416a8f8070074 /drivers/staging/comedi | |
parent | 57e60850e741137b37c302a4b569d33ad97631b0 (diff) | |
download | linux-cd47e4d69abfd5a3e85ba4ff282db5acfffd6fc2.tar.bz2 |
staging: gdm724x: fix a couple array overflows
The find_dev_index() function is frustrating. If you give it an invalid
index then it returns 0. That was the intent except there is an
off-by-one so it can return MAX_NIC_TYPE which is one higher than we
want.
There is one caller which had a sanity check to catch invalid returns,
but the other two callers assumed that index was valid.
My feeling is that when we are given invalid indexes, that should be
treated like an error and we abandon what we were doing.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi')
0 files changed, 0 insertions, 0 deletions