From dd473e6c2864fcc71451cb938e76272d76bcd4fc Mon Sep 17 00:00:00 2001 From: Guru Das Srinagesh Date: Tue, 24 Aug 2021 13:03:51 -0700 Subject: [PATCH] haven: hh_rm_core: Change datatype of num_fragments Integer overflow can occur for a large value of req_buff_size because num_fragments is declared as u8. Declare it as int in order to prevent this from occurring. Change-Id: I9e3655af13134ec57d123317ebb7b287a7470a19 Signed-off-by: Guru Das Srinagesh Signed-off-by: Swetha Chikkaboraiah --- drivers/virt/haven/hh_rm_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/virt/haven/hh_rm_core.c b/drivers/virt/haven/hh_rm_core.c index eb5c9c56b83c..1e5a924c5c1b 100644 --- a/drivers/virt/haven/hh_rm_core.c +++ b/drivers/virt/haven/hh_rm_core.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2021, The Linux Foundation. All rights reserved. * */ @@ -485,7 +485,7 @@ static int hh_rm_send_request(u32 message_id, const void *req_buff_curr = req_buff; struct hh_rm_rpc_hdr *hdr; unsigned long tx_flags; - u8 num_fragments = 0; + u32 num_fragments = 0; size_t payload_size; void *send_buff; int i, ret;