From c6b88d0bc9b77d00cfc26ea79b49d7cac6b415c0 Mon Sep 17 00:00:00 2001 From: Subash Abhinov Kasiviswanathan Date: Tue, 5 Jan 2021 12:07:38 -0700 Subject: [PATCH] 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 Signed-off-by: Subash Abhinov Kasiviswanathan --- core/rmnet_genl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/rmnet_genl.c b/core/rmnet_genl.c index e52364ad3b7a..409c32e437c5 100644 --- a/core/rmnet_genl.c +++ b/core/rmnet_genl.c @@ -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;