w1: Split memcpy() of struct cn_msg flexible array
Changes
1 files changed · +2 −1
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| drivers/w1/w1_netlink.c | modified | +2 | −1 | View file |
drivers/w1/w1_netlink.c
View filediff --git a/drivers/w1/w1_netlink.c b/drivers/w1/w1_netlink.c
index fa490aa..db110cc 100644
--- a/drivers/w1/w1_netlink.c
+++ b/drivers/w1/w1_netlink.c
@@ -611,7 +611,8 @@ static void w1_cn_callback(struct cn_msg *cn, struct netlink_skb_parms *nsp)
}
atomic_set(&block->refcnt, 1);
block->portid = nsp->portid;
- memcpy(&block->request_cn, cn, sizeof(*cn) + cn->len);
+ block->request_cn = *cn;
+ memcpy(block->request_cn.data, cn->data, cn->len);
node = (struct w1_cb_node *)(block->request_cn.data + cn->len);
/* Sneeky, when not bundling, reply_size is the allocated space