Skip to content

Commit ac73bf5

Browse files
miniplidavem330
authored andcommitted
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 <minipli@googlemail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 162b2be commit ac73bf5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/connector/connector.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ int cn_netlink_send(struct cn_msg *msg, u32 __group, gfp_t gfp_mask)
109109

110110
data = nlmsg_data(nlh);
111111

112-
memcpy(data, msg, sizeof(*data) + msg->len);
112+
memcpy(data, msg, size);
113113

114114
NETLINK_CB(skb).dst_group = group;
115115

0 commit comments

Comments
 (0)