Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 788ABC05027 for ; Wed, 1 Feb 2023 12:23:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231892AbjBAMXR (ORCPT ); Wed, 1 Feb 2023 07:23:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231836AbjBAMXN (ORCPT ); Wed, 1 Feb 2023 07:23:13 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49190457E2; Wed, 1 Feb 2023 04:23:12 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0A70620DFF; Wed, 1 Feb 2023 12:23:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675254191; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ISPFAssdKTREKF1mv5BU3ewT5bNGU7OV/5fRIf6LT4Q=; b=FERQPGtJ1J4T/mOGkm82NrELUH92uLOFT4GYNrH0QjW6sxcf2xRSOwi5wHaWrKrePRl7Co ZJGR5xlq8vvKEJFzkcLKEWqcFFRnFNQahlB6mWSb/BUSbi7yz4z6cOmr39DfvWjdu5PB1W NZvszHZBuaIxa4yzM53YOuoM6QvzGGs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675254191; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ISPFAssdKTREKF1mv5BU3ewT5bNGU7OV/5fRIf6LT4Q=; b=DbG+f8DTU3GBBcbA5RzOygPXnJP0gzrqTtGAtaraJ7/oy/o0sXGzAPU+4+E8QtDCgjC4j2 GQEehltngTSEgQAQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id EAC6B1348C; Wed, 1 Feb 2023 12:23:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id MlHzOK5Z2mMNOQAAMHmgww (envelope-from ); Wed, 01 Feb 2023 12:23:10 +0000 Date: Wed, 01 Feb 2023 13:23:10 +0100 Message-ID: <878rhhy3pt.wl-tiwai@suse.de> From: Takashi Iwai To: Dan Carpenter Cc: Jaroslav Kysela , Takashi Iwai , Maxime Ripard , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH v2] ALSA: pci: lx6464es: fix a debug loop In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 31 Jan 2023 11:02:13 +0100, Dan Carpenter wrote: > > This loop accidentally reuses the "i" iterator for both the inside and > the outside loop. The value of MAX_STREAM_BUFFER is 5. I believe that > chip->rmh.stat_len is in the 2-12 range. If the value of .stat_len is > 4 or more then it will loop exactly one time, but if it's less then it > is a forever loop. > > It looks like it was supposed to combined into one loop where > conditions are checked. > > Fixes: 8e6320064c33 ("ALSA: lx_core: Remove useless #if 0 .. #endif") > Signed-off-by: Dan Carpenter > --- > v2: In the first version I just deleted the outside loop but that was > not the correct fix. Combine the conditions instead. Thanks, applied. Takashi