summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-06-26 21:20:52 -0700
committerDavid S. Miller <davem@davemloft.net>2012-06-26 21:20:52 -0700
commita8edf8a690817ebfe68aa14c4bc482f62699077f (patch)
tree45ca724d0db95f9bae3be643c72f18ea99a36bcd
parent8786395c6956ae16cd04cc8c55e0f5fcd45fa939 (diff)
downloadblackbird-obmc-linux-a8edf8a690817ebfe68aa14c4bc482f62699077f.tar.gz
blackbird-obmc-linux-a8edf8a690817ebfe68aa14c4bc482f62699077f.zip
gdm72xx: Move away from NLMSG_PUT().
And use nlmsg_data() while we're here too. Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/staging/gdm72xx/netlink_k.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/staging/gdm72xx/netlink_k.c b/drivers/staging/gdm72xx/netlink_k.c
index 292af0f7f451..d0cb48a932ee 100644
--- a/drivers/staging/gdm72xx/netlink_k.c
+++ b/drivers/staging/gdm72xx/netlink_k.c
@@ -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;
@@ -144,7 +148,5 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len)
}
ret = 0;
}
-
-nlmsg_failure:
return ret;
}
OpenPOWER on IntegriCloud