From: Mathias Krause <minipli@googlemail.com>
To: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Mathias Krause <minipli@googlemail.com>, netdev@vger.kernel.org
Subject: [PATCH 3/4] connector: use 'size' everywhere in cn_netlink_send()
Date: Mon, 30 Sep 2013 22:03:08 +0200 [thread overview]
Message-ID: <1380571389-15343-4-git-send-email-minipli@googlemail.com> (raw)
In-Reply-To: <1380571389-15343-1-git-send-email-minipli@googlemail.com>
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>
---
drivers/connector/connector.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index 0daa11e..a36749f 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;
--
1.7.10.4
next prev parent reply other threads:[~2013-09-30 20:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-30 20:03 [PATCH 0/4] connector fixes Mathias Krause
2013-09-30 20:03 ` [PATCH 1/4] proc connector: fix info leaks Mathias Krause
2013-09-30 20:03 ` [PATCH 2/4] connector: use nlmsg_len() to check message length Mathias Krause
2013-09-30 20:03 ` Mathias Krause [this message]
2013-09-30 20:03 ` [PATCH 4/4] connector - documentation: simplify netlink message length assignment Mathias Krause
2013-10-02 20:04 ` [PATCH 0/4] connector fixes David Miller
2013-10-06 20:46 ` Рустафа Джамурахметов
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1380571389-15343-4-git-send-email-minipli@googlemail.com \
--to=minipli@googlemail.com \
--cc=netdev@vger.kernel.org \
--cc=zbr@ioremap.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox