提交 4e10fd5b 编写于 作者: S Sasha Levin 提交者: David S. Miller

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: ba7d49b1 ("rtnetlink: provide api for getting and setting slave info")
Signed-off-by: NSasha Levin <sasha.levin@oracle.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 77751427
......@@ -2012,8 +2012,8 @@ static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh)
}
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册