summaryrefslogtreecommitdiff
path: root/sound/soc/intel/avs/debugfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/intel/avs/debugfs.c')
-rw-r--r--sound/soc/intel/avs/debugfs.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sound/soc/intel/avs/debugfs.c b/sound/soc/intel/avs/debugfs.c
index 4dfbff0ce508..c625cf879f17 100644
--- a/sound/soc/intel/avs/debugfs.c
+++ b/sound/soc/intel/avs/debugfs.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
//
-// Copyright(c) 2021-2022 Intel Corporation. All rights reserved.
+// Copyright(c) 2021-2022 Intel Corporation
//
// Authors: Cezary Rojewski <cezary.rojewski@intel.com>
// Amadeusz Slawinski <amadeuszx.slawinski@linux.intel.com>
@@ -10,6 +10,7 @@
#include <linux/kfifo.h>
#include <linux/wait.h>
#include <linux/sched/signal.h>
+#include <linux/string_helpers.h>
#include <sound/soc.h>
#include "avs.h"
#include "messages.h"
@@ -68,7 +69,6 @@ static ssize_t fw_regs_read(struct file *file, char __user *to, size_t count, lo
static const struct file_operations fw_regs_fops = {
.open = simple_open,
.read = fw_regs_read,
- .llseek = no_llseek,
};
static ssize_t debug_window_read(struct file *file, char __user *to, size_t count, loff_t *ppos)
@@ -93,7 +93,6 @@ static ssize_t debug_window_read(struct file *file, char __user *to, size_t coun
static const struct file_operations debug_window_fops = {
.open = simple_open,
.read = debug_window_read,
- .llseek = no_llseek,
};
static ssize_t probe_points_read(struct file *file, char __user *to, size_t count, loff_t *ppos)
@@ -145,7 +144,7 @@ static ssize_t probe_points_write(struct file *file, const char __user *from, si
int ret;
ret = parse_int_array_user(from, count, (int **)&array);
- if (ret < 0)
+ if (ret)
return ret;
num_elems = *array;
@@ -170,7 +169,6 @@ static const struct file_operations probe_points_fops = {
.open = simple_open,
.read = probe_points_read,
.write = probe_points_write,
- .llseek = no_llseek,
};
static ssize_t probe_points_disconnect_write(struct file *file, const char __user *from,
@@ -183,7 +181,7 @@ static ssize_t probe_points_disconnect_write(struct file *file, const char __use
int ret;
ret = parse_int_array_user(from, count, (int **)&array);
- if (ret < 0)
+ if (ret)
return ret;
num_elems = *array;
@@ -371,11 +369,14 @@ static ssize_t trace_control_write(struct file *file, const char __user *from, s
int ret;
ret = parse_int_array_user(from, count, (int **)&array);
- if (ret < 0)
+ if (ret)
return ret;
num_elems = *array;
- resource_mask = array[1];
+ if (!num_elems) {
+ ret = -EINVAL;
+ goto free_array;
+ }
/*
* Disable if just resource mask is provided - no log priority flags.
@@ -383,6 +384,7 @@ static ssize_t trace_control_write(struct file *file, const char __user *from, s
* Enable input format: mask, prio1, .., prioN
* Where 'N' equals number of bits set in the 'mask'.
*/
+ resource_mask = array[1];
if (num_elems == 1) {
ret = disable_logs(adev, resource_mask);
} else {