Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb0d7a51 authored by Nitin LNU's avatar Nitin LNU
Browse files

qseecom : qseecom_scale_bus_bandwidth doesn't check the negative mode



Place a min value check in qseecom_scale_bus_bandwidth

Change-Id: I6b551ee82987d2d7a2011e5d5fb667699d089a78
Signed-off-by: default avatarNitin LNU <quic_nlakra@quicinc.com>
parent 90de98df
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
 * QTI Secure Execution Environment Communicator (QSEECOM) driver
 *
 * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#define pr_fmt(fmt) "QSEECOM: %s: " fmt, __func__
@@ -1933,7 +1934,7 @@ static int qseecom_scale_bus_bandwidth(struct qseecom_dev_handle *data,
		pr_err("copy_from_user failed\n");
		return ret;
	}
	if (req_mode > HIGH) {
	if (req_mode > HIGH || req_mode < QSEECOM_STATE_NOT_READY) {
		pr_err("Invalid bandwidth mode (%d)\n", req_mode);
		return -EINVAL;
	}