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

Commit ee190b50 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: wcd934x-dsp-cntl: Limit array size of val"

parents a6ff4b8a d5ed5224
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -31,6 +31,7 @@
#define WCD_PROCFS_ENTRY_MAX_LEN 16
#define WCD_934X_RAMDUMP_START_ADDR 0x20100000
#define WCD_934X_RAMDUMP_SIZE ((1024 * 1024) - 128)
#define WCD_DSP_CNTL_MAX_COUNT 2

#define WCD_CNTL_MUTEX_LOCK(codec, lock)             \
{                                                    \
@@ -909,11 +910,11 @@ static ssize_t wcd_miscdev_write(struct file *filep, const char __user *ubuf,
{
	struct wcd_dsp_cntl *cntl = container_of(filep->private_data,
						 struct wcd_dsp_cntl, miscdev);
	char val[count];
	char val[WCD_DSP_CNTL_MAX_COUNT];
	bool vote;
	int ret = 0;

	if (count == 0 || count > 2) {
	if (count == 0 || count > WCD_DSP_CNTL_MAX_COUNT) {
		pr_err("%s: Invalid count = %zd\n", __func__, count);
		ret = -EINVAL;
		goto done;