diff options
| author | Agrawal Ashish <ashishka@qti.qualcomm.com> | 2016-02-11 16:20:17 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-02-17 13:19:18 +0530 |
| commit | 29ccc957100becbe71fa03c42c93cb0a112bde91 (patch) | |
| tree | d7bd3f9a17e0d74ebef8821a6f4ae270b4ec752e | |
| parent | 5e506db2e8468553dcc488fc14cc216c3498b737 (diff) | |
qcacld-2.0: Send proper length in netlink message.
While sending message between userspace and the driver
length of nlmsghdr should be added in skb in driver.
Change-Id: I69867f20dcf2a74bf4e630f957e0dc86f7c9ae54
CRs-Fixed: 975024
| -rw-r--r-- | CORE/SVC/src/logging/wlan_logging_sock_svc.c | 6 | ||||
| -rw-r--r-- | CORE/SVC/src/ptt/wlan_ptt_sock_svc.c | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/CORE/SVC/src/logging/wlan_logging_sock_svc.c b/CORE/SVC/src/logging/wlan_logging_sock_svc.c index 4b6daed65bc5..a5e0db2fb9b3 100644 --- a/CORE/SVC/src/logging/wlan_logging_sock_svc.c +++ b/CORE/SVC/src/logging/wlan_logging_sock_svc.c @@ -198,7 +198,8 @@ static int wlan_send_sock_msg_to_app(tAniHdr *wmsg, int radio, return -EINVAL; } - payload_len = wmsg_length + sizeof(wnl->radio); + payload_len = wmsg_length + sizeof(wnl->radio) + + sizeof(struct nlmsghdr); tot_msg_len = NLMSG_SPACE(payload_len); skb = dev_alloc_skb(tot_msg_len); if (skb == NULL) { @@ -616,7 +617,8 @@ static int send_filled_buffers_to_user(void) spin_unlock_irqrestore(&gwlan_logging.spin_lock, flags); /* 4 extra bytes for the radio idx */ payload_len = plog_msg->filled_length + - sizeof(wnl->radio) + sizeof(tAniHdr); + sizeof(wnl->radio) + sizeof(tAniHdr) + + sizeof(struct nlmsghdr); tot_msg_len = NLMSG_SPACE(payload_len); nlh = nlmsg_put(skb, 0, nlmsg_seq++, diff --git a/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c b/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c index b51fa3e16e5a..ce8dbed37eea 100644 --- a/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c +++ b/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c @@ -80,7 +80,8 @@ int ptt_sock_send_msg_to_app(tAniHdr *wmsg, int radio, int src_mod, int pid) __func__, radio); return -EINVAL; } - payload_len = wmsg_length + 4; // 4 extra bytes for the radio idx + /* 4 extra bytes for the radio idx */ + payload_len = wmsg_length + 4 + sizeof(struct nlmsghdr); tot_msg_len = NLMSG_SPACE(payload_len); if ((skb = dev_alloc_skb(tot_msg_len)) == NULL) { PTT_TRACE(VOS_TRACE_LEVEL_ERROR, "%s: dev_alloc_skb() failed for msg size[%d]\n", |
