soundwire: debugfs: move debug statement outside of error handling
PATCH v3 1/1 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.
---
Changelog:
v3: removed superfluous initialization of ktime_t vars
v2: https://lore.kernel.org/linux-sound/aF2Em76RGWVpJfg-@vaman/T/#mb875b96a6dc1bd18a939caf1d3288b3b3b5e78c3
v1: https://lore.kernel.org/linux-sound/[email protected]/#t
--- drivers/soundwire/debugfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/soundwire/debugfs.c +3 -3
@@ -291,6 +291,9 @@ static int cmd_go(void *data, u64 value) finish_t =ktime_get (); +dev_dbg (&slave->dev,"command completed, num_byte %zu status %d, time %lld ms\n" , + num_bytes, ret,div_u64 (finish_t - start_t,NSEC_PER_MSEC )); + out:if (fw)release_firmware (fw);
@@ -298,9 +301,6 @@ static int cmd_go(void *data, u64 value)pm_runtime_mark_last_busy (&slave->dev);pm_runtime_put (&slave->dev); -dev_dbg (&slave->dev,"command completed, num_byte %zu status %d, time %lld ms\n" , - num_bytes, ret,div_u64 (finish_t - start_t,NSEC_PER_MSEC )); -return ret; } DEFINE_DEBUGFS_ATTRIBUTE(cmd_go_fops, NULL,
Signature · 1 line
2.49.0
Quoted 8 lines · Rodrigo Gobbi
The
start_tandfinish_tvariables are not properly initialized if errors happens overrequest_firmwareactions.
This was also detected by smatch:
drivers/soundwire/debugfs.c:301cmd_go()error: uninitialized symbol 'finish_t'.drivers/soundwire/debugfs.c:301cmd_go()error: uninitialized symbol 'start_t'.[...]
Applied, thanks!
[1/1] soundwire: debugfs: move debug statement outside of error handling
commit: 06f77ff9d852c9f2764659ea81489364d8a69a9c
Best regards,
Signature · 1 line
~Vinod