Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp143970rwr; Thu, 4 May 2023 00:14:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7TeWMeS0ReWijGbeEjmnFaWX8swUu6qj/fp1ud28yQM5rj0yYZ4WUS7vB6gqy84Xma8ybe X-Received: by 2002:a05:6a20:2445:b0:f6:28de:89e1 with SMTP id t5-20020a056a20244500b000f628de89e1mr1688444pzc.33.1683184469460; Thu, 04 May 2023 00:14:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683184469; cv=none; d=google.com; s=arc-20160816; b=gxrjQssPdNreV5SWRHK/EdXvLuS7alfypxasORtKu0sY3lpd2PoqXKnCIMMjhOnWQW eTWy2vUuG0rhWA5P+opc+sXJn1Vvni/4KNB9LHKFRR5YnYTXe9IEekOxO2kmxWMUYH0L s4n7LNt4DhY9dyAHrwn8v5Ze8xR/MJETXPI98q4KnPDz82j3HgNtKe35l3TALpsozAOq uoz6i4x5reYrbuOscV9uNVbyoaRc2BaVFFr5oLVE3V+YmaxEUQV/4uhR6y/+5cNs9Vul XYCWG+eerROdMLRO9wN9QxZJRHRMfTLPwGIq1k9KjkiOsH1xneJVcFMA43KqTQkBbXvo zdrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=zpfyKXtoZcH9RyWOqcte/baGt20aURAO0A0qNxceyJY=; b=KTAST0XuLckLDt/bNAeeIx/nGT4KC51KOPXJKuRYTGvN0c+hm1tCvYhrW6q41E4MMp v0sHkNV24krDsEjat2ZmvRe+HMf3e+v4rb78BIeT8dZiHavDeCW9r7HTbu+Baojv49hP EpMflIRsCniskA8x7X1MbIXlZmDvZxO0z7KWZIqCuYhcF6YXH485MoGN8+DrlCA5MWoj u+fzF/S+jXjedFt1HnzAY1b4C+PALt2A+B9XconuXSAoR/kuqUGcUrpas84YaZaYPFPe fPMBC2MyQv5aNYxLMWWEwOKJuvNQyWUYn3eTCSGI1fBZdzSTzzYxs1XJu+QMXezSru7x /HTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 81-20020a630254000000b005096eb1dabbsi35729081pgc.716.2023.05.04.00.14.10; Thu, 04 May 2023 00:14:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229916AbjEDHFx (ORCPT + 99 others); Thu, 4 May 2023 03:05:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbjEDHFv (ORCPT ); Thu, 4 May 2023 03:05:51 -0400 X-Greylist: delayed 657 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 04 May 2023 00:05:48 PDT Received: from mail.bugwerft.de (mail.bugwerft.de [46.23.86.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CBDD11731 for ; Thu, 4 May 2023 00:05:48 -0700 (PDT) Received: from [192.168.178.88] (p57bc9658.dip0.t-ipconnect.de [87.188.150.88]) by mail.bugwerft.de (Postfix) with ESMTPSA id 7F2DA28054E; Thu, 4 May 2023 06:54:49 +0000 (UTC) Message-ID: <81a2e61f-5b30-06c9-6773-70c89c836fa7@zonque.org> Date: Thu, 4 May 2023 08:54:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] sound: caiaq: input: Add error handling for unsupported input methods in `snd_usb_caiaq_input_init` To: Ruliang Lin , Jaroslav Kysela , Takashi Iwai , Karsten Wiese Cc: hust-os-kernel-patches@googlegroups.com, Dongliang Mu , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org References: <20230504065054.3309-1-u202112092@hust.edu.cn> Content-Language: en-US From: Daniel Mack In-Reply-To: <20230504065054.3309-1-u202112092@hust.edu.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 On 5/4/23 08:50, Ruliang Lin wrote: > Smatch complains that: > snd_usb_caiaq_input_init() warn: missing error code 'ret' > > This patch adds a new case to handle the situation where the > device does not support any input methods in the > `snd_usb_caiaq_input_init` function. It returns an `-EINVAL` error code > to indicate that no input methods are supported on the device. > > Fixes: 523f1dce3743 ("[ALSA] Add Native Instrument usb audio device support") > Signed-off-by: Ruliang Lin > Reviewed-by: Dongliang Mu Acked-by: Daniel Mack > --- > The issue is found by static analyzer. The patched code has passed > Smatch checker, but remains untested on real device. > --- > sound/usb/caiaq/input.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/sound/usb/caiaq/input.c b/sound/usb/caiaq/input.c > index 1e2cf2f08eec..84f26dce7f5d 100644 > --- a/sound/usb/caiaq/input.c > +++ b/sound/usb/caiaq/input.c > @@ -804,6 +804,7 @@ int snd_usb_caiaq_input_init(struct snd_usb_caiaqdev *cdev) > > default: > /* no input methods supported on this device */ > + ret = -EINVAL; > goto exit_free_idev; > } >