Message ID | 20230130141532.102838-1-o-takashi@sakamocchi.jp (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | ALSA: firewire-lib: fix uninitialized local variable | expand |
On Mon, 30 Jan 2023 15:15:32 +0100, Takashi Sakamoto wrote: > > The function local variable, curr_cycle_time is declared without > initialization. When tracepoints event is not probed, it looks to be > used as is. This commit fixes it. Fortunately, the value of local variable > is not used unless the event is probed, thus this commit is for better > coding. > > Reported-by: Dan Carpenter <error27@gmail.com> > Fixes: fef4e61b0b7 ("ALSA: firewire-lib: extend tracepoints event including CYCLE_TIME of 1394 OHCI") > Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Thanks, applied now (with the correction of Fixes tag). Takashi
diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index f7e1329efa0b..a13c0b408aad 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -910,7 +910,7 @@ static int generate_tx_packet_descs(struct amdtp_stream *s, struct pkt_desc *des unsigned int dbc = s->data_block_counter; unsigned int packet_index = s->packet_index; unsigned int queue_size = s->queue_size; - u32 curr_cycle_time; + u32 curr_cycle_time = 0; int i; int err;
The function local variable, curr_cycle_time is declared without initialization. When tracepoints event is not probed, it looks to be used as is. This commit fixes it. Fortunately, the value of local variable is not used unless the event is probed, thus this commit is for better coding. Reported-by: Dan Carpenter <error27@gmail.com> Fixes: fef4e61b0b7 ("ALSA: firewire-lib: extend tracepoints event including CYCLE_TIME of 1394 OHCI") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> --- sound/firewire/amdtp-stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)