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

Unverified Commit 13d3be4d authored by Soumya Managoli's avatar Soumya Managoli Committed by Michael Bestas
Browse files

dsp: q6adm: Resolve mem corruption in adm cb



Conversion of negative "num_modules" var value
will result in max possible unsigned int value
and hence can cause mem corruption when accessed.

Resolve this by assigning the same data type
to "num_modules" var as used in the calling fn.

Change-Id: I4c9d7215b9c7345637e1eb3a1992a41fef71c5cb
Signed-off-by: default avatarSoumya Managoli <quic_c_smanag@quicinc.com>
parent 6a6c3902
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/*
/*
 * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
 */
 */
#include <linux/module.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/slab.h>
@@ -1550,7 +1551,7 @@ static int32_t adm_callback(struct apr_client_data *data, void *priv)
{
{
	uint32_t *payload;
	uint32_t *payload;
	int port_idx, copp_idx, idx, client_id;
	int port_idx, copp_idx, idx, client_id;
	int num_modules;
	uint32_t num_modules;
	int ret;
	int ret;


	if (data == NULL) {
	if (data == NULL) {