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

Commit df9a245b authored by Soumya Managoli's avatar Soumya Managoli Committed by Gerrit - the friendly Code Review server
Browse files

dsp: q6lsm: Add check for payload buffer



Check get_param_payload buffer ptr before accessing.

Change-Id: I5470983188dffeec14965a5cdec30747b98735e7
Signed-off-by: default avatarSoumya Managoli <quic_c_smanag@quicinc.com>
parent 07c54eab
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2013-2020, Linux Foundation. All rights reserved.
 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
 */
#include <linux/fs.h>
#include <linux/mutex.h>
@@ -235,6 +236,11 @@ static int q6lsm_callback(struct apr_client_data *data, void *priv)
			goto done;
		}

		if (!client->get_param_payload) {
			pr_err("%s: invalid get_param_payload buffer ptr\n", __func__);
			ret = -EINVAL;
			goto done;
		}
		memcpy((u8 *)client->get_param_payload,
			(u8 *)payload + payload_min_size_expected, param_size);
done: