Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1604127pxb; Tue, 8 Feb 2022 23:49:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJyu1vM6YooMhaztDVbbY7/corA5Os3zag2gu/DPSyf2Xxm00ZBaXLbSu29Lj1Mosls9RMav X-Received: by 2002:a17:90b:1bc9:: with SMTP id oa9mr1163793pjb.27.1644392960307; Tue, 08 Feb 2022 23:49:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644392960; cv=none; d=google.com; s=arc-20160816; b=aj6DF5qZP8mLgbIg1V9jRSythcilkDbNySE12Dkys2ydGG6FFnhf4dkvchmXzphmVU +/HwLp8yvs/FflMEtahho5Nz9L5hVKZ3S3M5RasUW/13tR6HmaTFx/uZbo7zsbwTG9dc z9+rM66SPW5MVzNtcUU/9bLd8ZRsvM1XA7tmxRsx3AdoxTLD6oTxmnLn9K4n4oIYvjfU wt+CSsOTWnOglwxqP79N56oAFKhS79i4qKeUPrWP8z0MpPn16ZFj13cAKc5i7pCuK0+l Bl9ayjDR3AgPb4fNgXh5hJ1XmVoPjvOs2WUVM7xpO7cUNrRM1UiGs7LXkM7HIMPdTAOw qzkQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hUiTb9EWDr2/WZSO/87SXIlL1pOH8Hibbc2bZnDl+S8=; b=nLQFF+zml6MYcBwT54cxdOCll04+jn6KBkk94k1tk5gSfsmGLfNuGI25F22S5jGjot knFhosuaScI1FMCWd9rF9r5lhsX73NhWNOdNWvWD1268ohXDZAwcsvDTVDaZpt6bTZol QnRO68gA7cZTzF48tXX52Ad8FvXLdsH5bB3aZZmF93Fj31M3lmKoZuETn5yrMr2KGAXS C24jxOtJByshe7GRW4THioPJimAdoIw6Jx0KfJY/FCCuBf3I0niRHHzL53gBt6y1v/+l im6riIEdsw5Op7TTD38ySeS+cSqF1yqEAkJFNqi8xh/IRm6MbrT9FCFHblWRk+FgtTzb h4Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VHuxb3Hx; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s5si3987943pju.72.2022.02.08.23.49.06; Tue, 08 Feb 2022 23:49:20 -0800 (PST) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VHuxb3Hx; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352385AbiBGLtK (ORCPT + 99 others); Mon, 7 Feb 2022 06:49:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386636AbiBGLfN (ORCPT ); Mon, 7 Feb 2022 06:35:13 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28B4AC043181; Mon, 7 Feb 2022 03:35:13 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CB421B80EBD; Mon, 7 Feb 2022 11:35:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D09B7C004E1; Mon, 7 Feb 2022 11:35:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644233710; bh=+IY6A+HUlenz/HqGjjxj3obMOLESQN8pG2bZR8pv5QI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VHuxb3Hxz6I0A4XEIYBuYkZJi7q92A+cBMD/eFCkjFrHSAnj690EO0Ayi90kQDR+G dx9asc8xyX6WXzLfk0/fFpubIJmerjHAqTAIq0eeUzobecQ6nncp4S9Z1t4JBGFhbV 1K8ZuQg3h7WSFd/jDVVLCafNELVdl2mjPIqdSjKc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Rix , Takashi Iwai Subject: [PATCH 5.16 054/126] ALSA: usb-audio: initialize variables that could ignore errors Date: Mon, 7 Feb 2022 12:06:25 +0100 Message-Id: <20220207103805.976127340@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220207103804.053675072@linuxfoundation.org> References: <20220207103804.053675072@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tom Rix commit 3da4b7403db87d39bc2613cfd790de1de99a70ab upstream. clang static analysis reports this representative issue mixer.c:1548:35: warning: Assigned value is garbage or undefined ucontrol->value.integer.value[0] = val; ^ ~~~ The filter_error() macro allows errors to be ignored. If errors can be ignored, initialize variables so garbage will not be used. Fixes: 48cc42973509 ("ALSA: usb-audio: Filter error from connector kctl ops, too") Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220126182142.1184819-1-trix@redhat.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/usb/mixer.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -1526,6 +1526,10 @@ error: usb_audio_err(chip, "cannot get connectors status: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n", UAC_GET_CUR, validx, idx, cval->val_type); + + if (val) + *val = 0; + return filter_error(cval, ret); }