diff options
author | Sasha Levin <sasha.levin@oracle.com> | 2015-02-24 22:14:35 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-24 23:39:09 +0300 |
commit | 4e10fd5b4a7f4100007147558c304da3e73b25cf (patch) | |
tree | 56594dc614d5dac3533583fc9c230d23ccc37d1d /net/core/rtnetlink.c | |
parent | 77751427a1ff25b27d47a4c36b12c3c8667855ac (diff) | |
download | linux-4e10fd5b4a7f4100007147558c304da3e73b25cf.tar.xz |
rtnetlink: avoid 0 sized arrays
Arrays (when not in a struct) "shall have a value greater than zero".
GCC complains when it's not the case here.
Fixes: ba7d49b1f0 ("rtnetlink: provide api for getting and setting slave info")
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/rtnetlink.c')
-rw-r--r-- | net/core/rtnetlink.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index ab293a3066b3..1385de0fa080 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -2012,8 +2012,8 @@ replay: } if (1) { - struct nlattr *attr[ops ? ops->maxtype + 1 : 0]; - struct nlattr *slave_attr[m_ops ? m_ops->slave_maxtype + 1 : 0]; + struct nlattr *attr[ops ? ops->maxtype + 1 : 1]; + struct nlattr *slave_attr[m_ops ? m_ops->slave_maxtype + 1 : 1]; struct nlattr **data = NULL; struct nlattr **slave_data = NULL; struct net *dest_net, *link_net = NULL; |