diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2020-09-10 13:08:05 +0300 |
---|---|---|
committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2020-09-10 19:39:56 +0300 |
commit | 77e4907fa620af102f4571d4edb0dcc95b4fa083 (patch) | |
tree | 7eaf8cd3dae8dcc3b18cab08e521d5c64440d8dc /drivers/thunderbolt/debugfs.c | |
parent | 54e418106c765c5f3c378c770b0f8518632830da (diff) | |
download | linux-77e4907fa620af102f4571d4edb0dcc95b4fa083.tar.xz |
thunderbolt: debugfs: Fix uninitialized return in counters_write()
If the first line is in an invalid format then the "ret" value is
uninitialized. We should return -EINVAL instead.
Fixes: 54e418106c76 ("thunderbolt: Add debugfs interface")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/debugfs.c')
-rw-r--r-- | drivers/thunderbolt/debugfs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/thunderbolt/debugfs.c b/drivers/thunderbolt/debugfs.c index fdfe6e4afbfe..3680b2784ea1 100644 --- a/drivers/thunderbolt/debugfs.c +++ b/drivers/thunderbolt/debugfs.c @@ -231,6 +231,7 @@ static ssize_t counters_write(struct file *file, const char __user *user_buf, char *line = buf; u32 val, offset; + ret = -EINVAL; while (parse_line(&line, &offset, &val, 1, 4)) { ret = tb_port_write(port, &val, TB_CFG_COUNTERS, offset, 1); |