Browse Source

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>
Sasha Levin 10 years ago
parent
commit
4e10fd5b4a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      net/core/rtnetlink.c

+ 2 - 2
net/core/rtnetlink.c

@@ -2012,8 +2012,8 @@ replay:
 	}
 	}
 
 
 	if (1) {
 	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 **data = NULL;
 		struct nlattr **slave_data = NULL;
 		struct nlattr **slave_data = NULL;
 		struct net *dest_net, *link_net = NULL;
 		struct net *dest_net, *link_net = NULL;