Commit 97f53046 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mark Brown

ASoC: SOF: remove superfluous NULL check in debugfs read

When reading from IPC flood debugfs entries no need to check whether
.cache_buf is NULL - it's impossible since otherwise the initialisation
would have failed. This also fixes a klocwork reported issue:

passed to function and may be dereferenced there by passing argument 2
to function 'memcpy' at line 510.
sound/soc/sof/debug.c:510 | sof_dfsentry_read()
Reported-by: default avatarKeqiao Zhang <keqiao.zhang@intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarXiuli Pan <xiulipan@outlook.com>
Signed-off-by: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210315163932.18663-4-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 72c35856
...@@ -451,8 +451,7 @@ static ssize_t sof_dfsentry_read(struct file *file, char __user *buffer, ...@@ -451,8 +451,7 @@ static ssize_t sof_dfsentry_read(struct file *file, char __user *buffer,
dentry = file->f_path.dentry; dentry = file->f_path.dentry;
if ((!strcmp(dentry->d_name.name, "ipc_flood_count") || if ((!strcmp(dentry->d_name.name, "ipc_flood_count") ||
!strcmp(dentry->d_name.name, "ipc_flood_duration_ms")) && !strcmp(dentry->d_name.name, "ipc_flood_duration_ms"))) {
dfse->cache_buf) {
if (*ppos) if (*ppos)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment