Skip to content

Commit 3620c53

Browse files
lyakhbardliao
authored andcommitted
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: Keqiao Zhang <keqiao.zhang@intel.com> Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent ab37cb8 commit 3620c53

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎sound/soc/sof/debug.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,7 @@ static ssize_t sof_dfsentry_read(struct file *file, char __user *buffer,
451451

452452
dentry = file->f_path.dentry;
453453
if ((!strcmp(dentry->d_name.name, "ipc_flood_count") ||
454-
!strcmp(dentry->d_name.name, "ipc_flood_duration_ms")) &&
455-
dfse->cache_buf) {
454+
!strcmp(dentry->d_name.name, "ipc_flood_duration_ms"))) {
456455
if (*ppos)
457456
return 0;
458457

0 commit comments

Comments
 (0)