summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-06-10 16:20:25 (GMT)
committerThomas Haller <thaller@redhat.com>2014-06-10 19:45:33 (GMT)
commitbb44548b924d41b148c39ab5f4907c52bcba1003 (patch)
treef29ced1bac80257805f94be7691229e1f4843941
parent6608cd5d7242a8b58e62208e71b6c276434566ec (diff)
downloadlibnl-bb44548b924d41b148c39ab5f4907c52bcba1003.zip
libnl-bb44548b924d41b148c39ab5f4907c52bcba1003.tar.gz
libnl-bb44548b924d41b148c39ab5f4907c52bcba1003.tar.bz2
route/link: pass proper type to sizeof() for calloc() in vlan_parse()
This fixes the following coverity warning: lib/route/link/vlan.c:148:23:warning – Result of 'calloc' is converted to a pointer of type 'struct vlan_map', which is incompatible with sizeof operand type 'struct ifla_vlan_qos_mapping' This was not a real problem, because the types are effectively the same. Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r--lib/route/link/vlan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/route/link/vlan.c b/lib/route/link/vlan.c
index 1a0d916..b9f0c66 100644
--- a/lib/route/link/vlan.c
+++ b/lib/route/link/vlan.c
@@ -145,7 +145,7 @@ static int vlan_parse(struct rtnl_link *link, struct nlattr *data,
/* align to have a little reserve */
vi->vi_egress_size = (i + 32) & ~31;
- vi->vi_egress_qos = calloc(vi->vi_egress_size, sizeof(*map));
+ vi->vi_egress_qos = calloc(vi->vi_egress_size, sizeof(*vi->vi_egress_qos));
if (vi->vi_egress_qos == NULL)
return -NLE_NOMEM;