Skip to content

Commit

Permalink
gdm72xx: Move away from NLMSG_PUT().
Browse files Browse the repository at this point in the history
And use nlmsg_data() while we're here too.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jun 27, 2012
1 parent 8786395 commit a8edf8a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/staging/gdm72xx/netlink_k.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,12 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len)
}

seq++;
nlh = NLMSG_PUT(skb, 0, seq, type, len);
memcpy(NLMSG_DATA(nlh), msg, len);
nlh = nlmsg_put(skb, 0, seq, type, len, 0);
if (!nlh) {
kfree_skb(skb);
return -EMSGSIZE;
}
memcpy(nlmsg_data(nlh), msg, len);

NETLINK_CB(skb).pid = 0;
NETLINK_CB(skb).dst_group = 0;
Expand All @@ -144,7 +148,5 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len)
}
ret = 0;
}

nlmsg_failure:
return ret;
}

0 comments on commit a8edf8a

Please sign in to comment.