Home
last modified time | relevance | path

Searched hist:fdd1a8103a6df50bdeacd8bb04c3f6976cb9ae41 (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/net/atm/
H A Dlec.cdiff fdd1a8103a6df50bdeacd8bb04c3f6976cb9ae41 Fri May 03 07:39:48 CDT 2019 Dan Carpenter <dan.carpenter@oracle.com> net: atm: clean up a range check

The code works fine but the problem is that check for negatives is a
no-op:

if (arg < 0)
i = 0;

The "i" value isn't used. We immediately overwrite it with:

i = array_index_nospec(arg, MAX_LEC_ITF);

The array_index_nospec() macro returns zero if "arg" is out of bounds so
this works, but the dead code is confusing and it doesn't look very
intentional.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>