Skip to content

Commit

Permalink
infiniband: Stop using NLA_PUT*().
Browse files Browse the repository at this point in the history
These macros contain a hidden goto, and are thus extremely error
prone and make code hard to audit.

Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Apr 2, 2012
1 parent 6662df3 commit 4e24ffa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/infiniband/core/netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ int ibnl_put_attr(struct sk_buff *skb, struct nlmsghdr *nlh,
unsigned char *prev_tail;

prev_tail = skb_tail_pointer(skb);
NLA_PUT(skb, type, len, data);
if (nla_put(skb, type, len, data))
goto nla_put_failure;
nlh->nlmsg_len += skb_tail_pointer(skb) - prev_tail;
return 0;

Expand Down

0 comments on commit 4e24ffa

Please sign in to comment.