[PATCH][next] ALSA: firewire-lib: Fix uninitialized variable err issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Colin Ian King <colin.king@xxxxxxxxxxxxx>

Currently in the case where the payload_length is less than the
cip_header_size the error return variable err is not being set
and function parse_ir_ctx_header can return an uninitialized
error return value. Fix this by setting err to zero.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: c09010eeb373 ("ALSA: firewire-lib: handle the case that empty isochronous packet payload for CIP")
Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
---
 sound/firewire/amdtp-stream.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c
index af5c3629f1ac..242b1147d768 100644
--- a/sound/firewire/amdtp-stream.c
+++ b/sound/firewire/amdtp-stream.c
@@ -663,6 +663,7 @@ static int parse_ir_ctx_header(struct amdtp_stream *s, unsigned int cycle,
 		} else {
 			// Handle the cycle so that empty packet arrives.
 			cip_header = NULL;
+			err = 0;
 			*data_blocks = 0;
 			*syt = 0;
 		}
-- 
2.31.1




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux