From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D502A4BEE20; Sat, 12 Sep 2026 14:20:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789222838; cv=none; b=DeJIiFIZptdd3QYhcxKcx2tZttzvMhz73B8Ew/IQWKhC1EBxB2l2kv0d+syDyBZWI2HlpgZsRBvSV7SD4HnYJq+5FN5sxJYLaCXP/k3R3bOEJTgbf6PDjIW7ssAKQuou9BU3zo05Sa/SgINvKkSzkwpX8JthBZMbEBcENmQNCwg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789222838; c=relaxed/simple; bh=nV5ZRCfv4xq1+4WvR1/wdvRqvzLU6YS7IjZr6lw14+M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VMKGVmM2O3QIKamKJaFZrvjYi+Hxsa3NP+M/olpxQKsFaai0AStltWdi6PMjW/Jy3hXPIPf4RqYQ6sMLz+R66KiXq93p/ugUw8SHK0UKKE379IUk/G4QTL1jR+rhzPVLZpdzcYolK1erCPUiy5NcJDPfXdJODKAvNV6rNtaB6DY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=W6XIOg+Y; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="W6XIOg+Y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E2B11F000FF; Sat, 12 Sep 2026 14:20:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789222836; bh=acNTvAWrR2eDgMt5CIIqyjvAC5B+0l5je0ROhzNIzbE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=W6XIOg+Y3RZl8nj3dgtZSeimAa687dHgL3grJGd+rVlR/IwI9FviM2bSICsALYQfG +9+ZFkwZjMGW+uDa497a5OaN/YJtimNdB/1I8MJJSjbftICCgIRqOI+8DY/XgVHigC l2y3v9vOWrGsVuWeWmnrjl2UtE8kTWL3EdEsJRaQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Evgenii Burenchev , Takashi Iwai , Sasha Levin Subject: [PATCH 6.6 0666/1424] ALSA: via82xx: Remove unreachable branch in snd_via686_pcm_pointer() Date: Sat, 12 Sep 2026 08:51:38 +0200 Message-ID: <20260912065622.209156005@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.279695368@linuxfoundation.org> References: <20260912065607.279695368@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Evgenii Burenchev [ Upstream commit cd3447e1b6425efd1704ed07f1f245c842927eb0 ] The condition if (count && size < count) can never evaluate to true. The VIA DMA count register is masked with 0x00ffffff before use, while the DMA buffer size is limited to 0x00fffffe bytes. As a result, 'count' can never exceed 'size', making the condition permanently false. This branch has therefore been unreachable since the driver was introduced. Remove the unreachable branch without changing runtime behavior. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Evgenii Burenchev Link: https://patch.msgid.link/20260706131638.15311-1-evg28bur@yandex.ru Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/pci/via82xx_modem.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c index ca7f024bf8ec6..473024e7d8ff5 100644 --- a/sound/pci/via82xx_modem.c +++ b/sound/pci/via82xx_modem.c @@ -576,24 +576,18 @@ static inline unsigned int calc_linear_pos(struct via82xx_modem *chip, viadev->bufsize2, viadev->idx_table[idx].offset, viadev->idx_table[idx].size, count); #endif - if (count && size < count) { + if (! count) + /* bogus count 0 on the DMA boundary? */ + res = viadev->idx_table[idx].offset; + else + /* count register returns full size + * when end of buffer is reached + */ + res = viadev->idx_table[idx].offset + size; + if (check_invalid_pos(viadev, res)) { dev_dbg(chip->card->dev, - "invalid via82xx_cur_ptr, using last valid pointer\n"); + "invalid via82xx_cur_ptr (2), using last valid pointer\n"); res = viadev->lastpos; - } else { - if (! count) - /* bogus count 0 on the DMA boundary? */ - res = viadev->idx_table[idx].offset; - else - /* count register returns full size - * when end of buffer is reached - */ - res = viadev->idx_table[idx].offset + size; - if (check_invalid_pos(viadev, res)) { - dev_dbg(chip->card->dev, - "invalid via82xx_cur_ptr (2), using last valid pointer\n"); - res = viadev->lastpos; - } } } viadev->lastpos = res; /* remember the last position */ -- 2.53.0