Skip to content

Commit 06f77ff

Browse files
losgobbivinodkoul
authored andcommitted
soundwire: debugfs: move debug statement outside of error handling
The start_t and finish_t variables are not properly initialized if errors happens over request_firmware actions. This was also detected by smatch: drivers/soundwire/debugfs.c:301 cmd_go() error: uninitialized symbol 'finish_t'. drivers/soundwire/debugfs.c:301 cmd_go() error: uninitialized symbol 'start_t'. Move the debug statement outside of firmware error handling. Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/linux-sound/0db6d0bf-7bac-43a7-b624-a00d3d2bf829@stanley.mountain/ Fixes: bb5cb09 ("soundwire: debugfs: add interface for BPT/BRA transfers") Link: https://lore.kernel.org/r/20250626213628.9575-1-rodrigo.gobbi.7@gmail.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 72bbf6e commit 06f77ff

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/soundwire/debugfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,16 +291,16 @@ static int cmd_go(void *data, u64 value)
291291

292292
finish_t = ktime_get();
293293

294+
dev_dbg(&slave->dev, "command completed, num_byte %zu status %d, time %lld ms\n",
295+
num_bytes, ret, div_u64(finish_t - start_t, NSEC_PER_MSEC));
296+
294297
out:
295298
if (fw)
296299
release_firmware(fw);
297300

298301
pm_runtime_mark_last_busy(&slave->dev);
299302
pm_runtime_put(&slave->dev);
300303

301-
dev_dbg(&slave->dev, "command completed, num_byte %zu status %d, time %lld ms\n",
302-
num_bytes, ret, div_u64(finish_t - start_t, NSEC_PER_MSEC));
303-
304304
return ret;
305305
}
306306
DEFINE_DEBUGFS_ATTRIBUTE(cmd_go_fops, NULL,

0 commit comments

Comments
 (0)