From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by gnuweeb.org (Postfix) with ESMTPS id 6D2477E2F4 for ; Fri, 11 Mar 2022 22:41:49 +0000 (UTC) Authentication-Results: gnuweeb.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=IoAw069B; dkim-atps=neutral Received: by mail-pg1-f171.google.com with SMTP id t187so8622553pgb.1 for ; Fri, 11 Mar 2022 14:41:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=ahqlChR4R/wAxZuLbVyGpPDOrLLpoD2GWFAgzdSRBio=; b=IoAw069B2W4wIr7xE+LDXabaoa+2tWXedXk/rq6DZFB8IcxmAaWTTW/pBRkvOn7FVC +MFMKZyLWIlTANF5Gqi9nD2rsmSG+BtOHVVFdSFdLPHXzJuKRor/a+tb/Ex1COmpfoUa CtHR8VLYvXi3kpB3lD69QCKRR+i6byWsp2NzolQjYj5uLyudCkocSjetC7vTwXLfKEr1 +y1Sj8kpOMM22wwZ1X7TypiPJEyvMh44YrnzznfjehIpm+H1lL6KmmEqGffUmOYav5sV Y7KSPE5zJ0fLeth3SxUapx/QT4P/9N0QziscnXZmyEjBIJxUSfwJSi6WgY3ms/S+mjTL frGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=ahqlChR4R/wAxZuLbVyGpPDOrLLpoD2GWFAgzdSRBio=; b=h5AIxcWLaLWP/guA+AwhoebXs7KaGNAYEaSst44BY4YgbKM8pSUOZ57PA2NdBmpbtP ZU6SY41Nvxc/3Putcv7wTXwuhANqmnPRF9YJ+mh/vE6Bm1acRe3GC++/rYpd5mJokDz0 kkfwqEPjfrj5gUvV47eeQ6rftcEJTZ1yp2d8qxGahI0Aax6RNIg+NIm7CeLELqo5vbAA saxWwhgIuqUmaxhECbimmFLhywIIpjP+zb/cezRwhJn8que8BpwBM00R6fsqwOLVh9IA 7fTAMJ/Zb87oVT4hQzfp5LVSC9mmmfojBQBBK/EDsoZzfumNCVmABuTTpHI+FNXjyKTe zNoA== X-Gm-Message-State: AOAM532PcHwM3k6S4cpWBdk1TJkS7eSGaXX9+HdAw6b/gd8jA+D2qaxO OmSvbV8RmjESW0ivbnbCjdg= X-Google-Smtp-Source: ABdhPJzcMneJKmqDp7c/GtxCPZtgbRZPV12HGejFy7ed9Jh/5L0eg3ehHhaIedcFBVm2GPz2gyoaEA== X-Received: by 2002:a63:2250:0:b0:372:c564:621b with SMTP id t16-20020a632250000000b00372c564621bmr10402978pgm.601.1647038508797; Fri, 11 Mar 2022 14:41:48 -0800 (PST) Received: from [192.168.43.69] ([182.2.70.192]) by smtp.gmail.com with ESMTPSA id e10-20020a056a00162a00b004f6fc39c081sm10736172pfc.211.2022.03.11.14.41.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Mar 2022 14:41:48 -0800 (PST) Message-ID: <7ea1ca0f-804c-bde8-6c75-5822f260531b@gmail.com> Date: Sat, 12 Mar 2022 05:41:42 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [ammarfaizi2-block:broonie/sound/for-5.18 33/171] sound/soc/sof/compress.c:54 snd_sof_compr_fragment_elapsed() warn: variable dereferenced before check 'cstream' (see line 48) Content-Language: en-US To: Dan Carpenter , kbuild@lists.01.org, Daniel Baluta Cc: lkp@intel.com, kbuild-all@lists.01.org, GNU/Weeb Mailing List , linux-kernel@vger.kernel.org, Mark Brown References: <202203120019.KjXsD7LN-lkp@intel.com> From: Ammar Faizi In-Reply-To: <202203120019.KjXsD7LN-lkp@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: On 3/12/22 1:59 AM, Dan Carpenter wrote: > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > Reported-by: Dan Carpenter > > New smatch warnings: > sound/soc/sof/compress.c:54 snd_sof_compr_fragment_elapsed() warn: variable dereferenced before check 'cstream' (see line 48) > > vim +/cstream +54 sound/soc/sof/compress.c > > 858f7a5c45cacb Daniel Baluta 2021-10-04 46 void snd_sof_compr_fragment_elapsed(struct snd_compr_stream *cstream) > 858f7a5c45cacb Daniel Baluta 2021-10-04 47 { > 6324cf901e14c6 Daniel Baluta 2022-01-20 @48 struct snd_soc_pcm_runtime *rtd = cstream->private_data; > ^^^^^^^^^^^^^^^^^^^^^^ > 6324cf901e14c6 Daniel Baluta 2022-01-20 49 struct snd_compr_runtime *crtd = cstream->runtime; > ^^^^^^^^^^^^^^^^^ > Dereference > > 858f7a5c45cacb Daniel Baluta 2021-10-04 50 struct snd_soc_component *component; > 6324cf901e14c6 Daniel Baluta 2022-01-20 51 struct snd_compr_tstamp *tstamp; > 858f7a5c45cacb Daniel Baluta 2021-10-04 52 struct snd_sof_pcm *spcm; > 858f7a5c45cacb Daniel Baluta 2021-10-04 53 > 858f7a5c45cacb Daniel Baluta 2021-10-04 @54 if (!cstream) > ^^^^^^^^ > Checked too late Hi Dan, Thanks for reporting, it has already been fixed in commit 7e4bfcf10a03981 ("ASoC: SOF: compress: fix null check after dereference") Link: https://git.kernel.org/broonie/sound/c/7e4bfcf10a03981 Regards, -- Ammar Faizi