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 <[email protected]> Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/linux-sound/[email protected]/ Fixes: bb5cb09 ("soundwire: debugfs: add interface for BPT/BRA transfers") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 72bbf6e commit 06f77ff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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)