From patchwork Thu Apr 18 17:49:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 789818 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp695799wrm; Thu, 18 Apr 2024 10:53:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW9S8xhaWlIl66xIVWRCc8NzgG3bn2UtoH456tSZu4FnkKHHN5DbXmziiA85+4WBQWu1OkjL/eCcU84vwrqoO9u X-Google-Smtp-Source: AGHT+IGsmbQJ6R30myGTOeOOeRLU2yrols0+GhnQDREod1Zp6EQoKBIaVI6RTIcVKuYQ6RU9O6nA X-Received: by 2002:a05:6214:d81:b0:69b:2515:4197 with SMTP id e1-20020a0562140d8100b0069b25154197mr5036979qve.13.1713462829164; Thu, 18 Apr 2024 10:53:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713462829; cv=none; d=google.com; s=arc-20160816; b=YeFvDJCgaJl+jX7v20Az1oslzO44Npj5lmFSAtGGGe4Tw0Fdwlf1RjGAjx5vVHjM5z FpNp5FggXWX1m2CaR2ZlBHdgDDmlJFPK55rR2IngeGSktgUXCqFVN6ig5fAx7a7udf8L 3fnyTpro+b+Lu48COmgcjyGaWl9AyfFCzGvSboA6OITFrIgupWYiscWpo+sieytxm/lG NZEx27U8habDKSrrthgaE/FxReJ9dSqL/DjRr3wFYXcaI5L+EdemQhAnVg1iISnTomDm By6a4DkwU8BdM0QyKGmRsdL+cjolMMevdt5CPZ33FJWHlQ4V5IrnD/H6aQ1uFtXCFk8O uhEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=qxC5EkeyehtqYkgTOeNbML1CeTXW92CNx5ixK5FjFRA=; fh=bvQH3M8eKczB5xekR9Uqz9KNidVz4Iv4rI6Pj4LuWBg=; b=pter9XXzkaFOtFOmPWomF3DUFV2W8uYO91y9XkCJFltTVyZ0kAF4X9CJAQH0yaVa5E inYzbbpVtjKlyitnn05iZQpnyTB63pUEinwoz7xVm8n9clnrQ1lu0LccY6U6MRb1Plgw DKYENiGhwwyiEQ0cYKOe0xuLYxMije2tLxwV80ooCI2JtAPnaHafNnq26GuuI5wmJpU5 Z1xTGum5fQHzl/VVMQVzMGEUUkMla81ZWIthgyIBNQFT9DngDeSLKohpJfp+ybGn1Yh+ KhZ91DranOJ68P5BRhQDueWNJOJcT5Ch+9uo9impeG4O9LmUHJWxCBT6i0BJ/JYnhp3u b+vQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jo19-20020a056214501300b0069b1f09605asi2079935qvb.301.2024.04.18.10.53.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Apr 2024 10:53:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxVvV-0003nN-5l; Thu, 18 Apr 2024 13:52:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxVvD-0002vn-Gf; Thu, 18 Apr 2024 13:51:43 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxVvB-0007gz-8n; Thu, 18 Apr 2024 13:51:43 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 1B7615FD77; Thu, 18 Apr 2024 20:50:05 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 59F7CB9351; Thu, 18 Apr 2024 20:50:02 +0300 (MSK) Received: (nullmailer pid 947872 invoked by uid 1000); Thu, 18 Apr 2024 17:49:55 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , Michael Tokarev Subject: [Stable-8.2.3 110/116] hw/audio/virtio-snd: Remove unused assignment Date: Thu, 18 Apr 2024 20:49:40 +0300 Message-Id: <20240418174955.947730-23-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Coverity reported: >>> CID 1542933: Code maintainability issues (UNUSED_VALUE) >>> CID 1542934: Code maintainability issues (UNUSED_VALUE) >>> Assigning value "NULL" to "stream" here, but that stored value is overwritten before it can be used. Simply remove the unused assignments. Resolves: Coverity CID 1542933 Resolves: Coverity CID 1542934 Fixes: 731655f87f ("virtio-snd: rewrite invalid tx/rx message handling") Fixes: 20cd0c8655 ("virtio-snd: rewrite invalid tx/rx message handling" in stable-8.2) Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis Message-Id: <20240410053712.34747-1-philmd@linaro.org> (cherry picked from commit dcb0a1ac03d6b5ba6c7fcbe467f0215738006113) Signed-off-by: Michael Tokarev diff --git a/hw/audio/virtio-snd.c b/hw/audio/virtio-snd.c index 256a132ece..823f9ab084 100644 --- a/hw/audio/virtio-snd.c +++ b/hw/audio/virtio-snd.c @@ -885,7 +885,9 @@ static void virtio_snd_handle_tx_xfer(VirtIODevice *vdev, VirtQueue *vq) } trace_virtio_snd_handle_tx_xfer(); - for (VirtIOSoundPCMStream *stream = NULL;; stream = NULL) { + for (;;) { + VirtIOSoundPCMStream *stream; + elem = virtqueue_pop(vq, sizeof(VirtQueueElement)); if (!elem) { break; @@ -964,7 +966,9 @@ static void virtio_snd_handle_rx_xfer(VirtIODevice *vdev, VirtQueue *vq) } trace_virtio_snd_handle_rx_xfer(); - for (VirtIOSoundPCMStream *stream = NULL;; stream = NULL) { + for (;;) { + VirtIOSoundPCMStream *stream; + elem = virtqueue_pop(vq, sizeof(VirtQueueElement)); if (!elem) { break;