rmnet_core: memset before sending genl response

Ensure that the generic netlink response has a memset payload
before sending to userspace.

Change-Id: Ie2fa92ce80bb3c0716e779cebeaedb2d31d759c1
Acked-by: Ryan Chapman <rchapman@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
This commit is contained in:
Subash Abhinov Kasiviswanathan 2021-01-05 12:07:38 -07:00
parent 607125c52c
commit c6b88d0bc9

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
/* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
*
* RMNET Data Generic Netlink
*
@ -322,9 +322,9 @@ int rmnet_core_genl_pid_bps_req_hdlr(struct sk_buff *skb_2,
rmnet_core_userspace_connected = 1;
/* Copy to pid/byte list to the payload */
memset(&pid_bps_resp, 0x0,
sizeof(pid_bps_resp));
if (is_req_valid) {
memset(&pid_bps_resp, 0x0,
sizeof(pid_bps_resp));
rmnet_create_pid_bps_resp(&pid_bps_resp);
}
pid_bps_resp.valid = 1;