Commit a898fe04 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

gianfar: correct filer table writing

MAX_FILER_IDX is the last usable index.  Using less-than
will already guarantee that one entry for catch-all rule
will be left, no need to subtract 1 here.
Signed-off-by: default avatarJakub Kicinski <kubakici@wp.pl>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b02e3e94
...@@ -1583,11 +1583,10 @@ static int gfar_write_filer_table(struct gfar_private *priv, ...@@ -1583,11 +1583,10 @@ static int gfar_write_filer_table(struct gfar_private *priv,
return -EBUSY; return -EBUSY;
/* Fill regular entries */ /* Fill regular entries */
for (; i < MAX_FILER_IDX - 1 && (tab->fe[i].ctrl | tab->fe[i].prop); for (; i < MAX_FILER_IDX && (tab->fe[i].ctrl | tab->fe[i].prop); i++)
i++)
gfar_write_filer(priv, i, tab->fe[i].ctrl, tab->fe[i].prop); gfar_write_filer(priv, i, tab->fe[i].ctrl, tab->fe[i].prop);
/* Fill the rest with fall-troughs */ /* Fill the rest with fall-troughs */
for (; i < MAX_FILER_IDX - 1; i++) for (; i < MAX_FILER_IDX; i++)
gfar_write_filer(priv, i, 0x60, 0xFFFFFFFF); gfar_write_filer(priv, i, 0x60, 0xFFFFFFFF);
/* Last entry must be default accept /* Last entry must be default accept
* because that's what people expect * because that's what people expect
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment