Message ID | 20211117210451.26415-3-ansuelsmth@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Multiple cleanup and feature for qca8k | expand |
On Wed, Nov 17, 2021 at 10:04:34PM +0100, Ansuel Smith wrote: > The very next check for port 0 and 6 already make sure we don't go out ~~~~ makes > of bounds with the ports_config delay table. > Remove the redundant check. > > Reported-by: kernel test robot <lkp@intel.com> > Reported-by: Dan Carpenter <dan.carpenter@oracle.com> > Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> > --- Reviewed-by: Vladimir Oltean <olteanv@gmail.com> > drivers/net/dsa/qca8k.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c > index a429c9750add..bfffc1fb7016 100644 > --- a/drivers/net/dsa/qca8k.c > +++ b/drivers/net/dsa/qca8k.c > @@ -983,7 +983,7 @@ qca8k_parse_port_config(struct qca8k_priv *priv) > u32 delay; > > /* We have 2 CPU port. Check them */ > - for (port = 0; port < QCA8K_NUM_PORTS && cpu_port_index < QCA8K_NUM_CPU_PORTS; port++) { > + for (port = 0; port < QCA8K_NUM_PORTS; port++) { > /* Skip every other port */ > if (port != 0 && port != 6) > continue; > -- > 2.32.0 >
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index a429c9750add..bfffc1fb7016 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -983,7 +983,7 @@ qca8k_parse_port_config(struct qca8k_priv *priv) u32 delay; /* We have 2 CPU port. Check them */ - for (port = 0; port < QCA8K_NUM_PORTS && cpu_port_index < QCA8K_NUM_CPU_PORTS; port++) { + for (port = 0; port < QCA8K_NUM_PORTS; port++) { /* Skip every other port */ if (port != 0 && port != 6) continue;
The very next check for port 0 and 6 already make sure we don't go out of bounds with the ports_config delay table. Remove the redundant check. Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> --- drivers/net/dsa/qca8k.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)