From: Mathias Krause Date: Mon, 30 Sep 2013 20:03:08 +0000 (+0200) Subject: connector: use 'size' everywhere in cn_netlink_send() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ac73bf50b709dea4e39635151b861b8a8f52bfbb;p=linux-beck.git connector: use 'size' everywhere in cn_netlink_send() We calculated the size for the netlink message buffer as size. Use size in the memcpy() call as well instead of recalculating it. Signed-off-by: Mathias Krause Signed-off-by: David S. Miller --- diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c index 0daa11e418b1..a36749f1e44a 100644 --- a/drivers/connector/connector.c +++ b/drivers/connector/connector.c @@ -109,7 +109,7 @@ int cn_netlink_send(struct cn_msg *msg, u32 __group, gfp_t gfp_mask) data = nlmsg_data(nlh); - memcpy(data, msg, sizeof(*data) + msg->len); + memcpy(data, msg, size); NETLINK_CB(skb).dst_group = group;