diff options
author | David S. Miller <davem@davemloft.net> | 2012-04-01 20:48:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-02 04:33:44 -0400 |
commit | 2809cec5b52b2d02fa0d7dab6e146abfc93c5b86 (patch) | |
tree | 2ece27cce40a138aaad94de47b354db5c1e562f3 /net/caif | |
parent | 14ad6647f3c919b4ee987e2058fbc6c10f29bb53 (diff) |
caif: Stop using NLA_PUT*().
These macros contain a hidden goto, and are thus extremely error
prone and make code hard to audit.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/caif')
-rw-r--r-- | net/caif/chnl_net.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/caif/chnl_net.c b/net/caif/chnl_net.c index 20618dd3088b..93e9c6dc9ddf 100644 --- a/net/caif/chnl_net.c +++ b/net/caif/chnl_net.c | |||
@@ -421,14 +421,14 @@ static int ipcaif_fill_info(struct sk_buff *skb, const struct net_device *dev) | |||
421 | struct chnl_net *priv; | 421 | struct chnl_net *priv; |
422 | u8 loop; | 422 | u8 loop; |
423 | priv = netdev_priv(dev); | 423 | priv = netdev_priv(dev); |
424 | NLA_PUT_U32(skb, IFLA_CAIF_IPV4_CONNID, | 424 | if (nla_put_u32(skb, IFLA_CAIF_IPV4_CONNID, |
425 | priv->conn_req.sockaddr.u.dgm.connection_id); | 425 | priv->conn_req.sockaddr.u.dgm.connection_id) || |
426 | NLA_PUT_U32(skb, IFLA_CAIF_IPV6_CONNID, | 426 | nla_put_u32(skb, IFLA_CAIF_IPV6_CONNID, |
427 | priv->conn_req.sockaddr.u.dgm.connection_id); | 427 | priv->conn_req.sockaddr.u.dgm.connection_id)) |
428 | goto nla_put_failure; | ||
428 | loop = priv->conn_req.protocol == CAIFPROTO_DATAGRAM_LOOP; | 429 | loop = priv->conn_req.protocol == CAIFPROTO_DATAGRAM_LOOP; |
429 | NLA_PUT_U8(skb, IFLA_CAIF_LOOPBACK, loop); | 430 | if (nla_put_u8(skb, IFLA_CAIF_LOOPBACK, loop)) |
430 | 431 | goto nla_put_failure; | |
431 | |||
432 | return 0; | 432 | return 0; |
433 | nla_put_failure: | 433 | nla_put_failure: |
434 | return -EMSGSIZE; | 434 | return -EMSGSIZE; |