Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2172408pxj; Thu, 20 May 2021 01:37:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoYZFlIOl4Zmhyb0aqxQAEJ2JZ0uM/qk9eOGMvzsKAzrBeiVUpp/bEHkHuTkU9vIJ9rOsW X-Received: by 2002:a50:fd17:: with SMTP id i23mr3931980eds.54.1621499827228; Thu, 20 May 2021 01:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621499827; cv=none; d=google.com; s=arc-20160816; b=xr/aUXM0ymb5AywdeL7v6QLfii/OSWBlCdKQ73uSsDxSU+knEAcz9A9vF8EUYo0QLb LSxqtXLA5H8vRIPJOoOtNgFY4JASLnOlOMBlYB1fl0KgjvBjAz6ErO84UlEn/I597V/B WqurQdJNqxuETJeO5eT7geoCuHe/hrTZVl6U1tiLLwg48MwH93EPe1IhiS3uBZRDYUDT KgHmoNvAm4o/EDh3yobHps1g5osNmVmyMi/if65JUEyWjzw1Bw5NlqsUNO274y/IbciS bw6rbYSv3JqdhqJpqoJK6CpoYpDcnfPrc+guCfw0DAKViqIQfS81/fHBSyB5n2btITWA VbqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=w3WTvDGwcwAjkck3TUE6xJchsX7Q97LV9NsAM7SRXV0=; b=v+0UARi2y4FO1KiBdQoEYO/Isi7ptHZTCmROJ5bQLylWiwgu2lfGCcwnQWx+DH4asn Gm5+PGnkdcMHIe8Y82Xyalm53pC1tCiKLVNhd3IlqhnyF9MSQIk79OWU2cak0FgfKdzW QDVUQpaKbHhOHVcye82jYbctbJenhCMseAfl3aQ2fMxh9P49lE9bL2ukRz/ujiLvVhpm 7HhteU5pxMK4gHmjzTteZ6HbUhvcaG5fh8/4WrOnnaUpI3kqiDMYtD2s0F6ZIb4oidaa Jtqtaulh9WjZP1Po30kB2lLY11w3mRgAhWaNBdVAOGh5btqvUlL00lg/obiMWkH8YbO2 JPFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x2si2161130ejs.198.2021.05.20.01.36.43; Thu, 20 May 2021 01:37:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231218AbhETIfx (ORCPT + 99 others); Thu, 20 May 2021 04:35:53 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:58421 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231193AbhETIfx (ORCPT ); Thu, 20 May 2021 04:35:53 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lje8P-00027g-0B; Thu, 20 May 2021 08:34:25 +0000 From: Colin King To: Clemens Ladisch , Takashi Sakamoto , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] ALSA: firewire-lib: Fix uninitialized variable err issue Date: Thu, 20 May 2021 09:34:24 +0100 Message-Id: <20210520083424.6685-1-colin.king@canonical.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King 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 --- 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