Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9107909pxu; Mon, 28 Dec 2020 06:50:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDZEF1/HjD8Vf1gwux5MTpk5zNj4QJvd1FS/A+5sRzQ0b1T6W5h47H06ZqC1q1mc9/qt+T X-Received: by 2002:a17:906:7f83:: with SMTP id f3mr31637107ejr.282.1609167048664; Mon, 28 Dec 2020 06:50:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609167048; cv=none; d=google.com; s=arc-20160816; b=zIt6+zqcSGPZZ9VRZqSGGwtL2MOoISf8HuYVQxlhhawyr9yJgUVZDS14WpMS4D19k1 GEhk7BRpZdIqWHmj8MopJkSrz6Btnj9aii9l7jukttvnL2INnK5cnX7JHQ3/hAJ33bTz kfW7bliks2tzL2k8Aw4qtjc/B4uQPAH/cTr4qsNwbC1omRGBC3h0k2JJJNXXoi/k3DBt 5QfWRhKMqcLtttTLYG41aUAkPEquYas+HiecJYCEBNIFYo7+UEN9FmmsZb178prmB5MG fYBdVh9MhM3P/7yX2iFkbcGfz9cdM9jzInETQHmhLLXm3iCg0S2d3VBW1cTr++U7TedC UTdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PfyKlR8QismXEjIxAuBEoRZlSXWjuKoZaL/ud9Gt7Hw=; b=XRCkafnUQOm/wLKOSyvFkCz+p1monoL5z0O17reWHtTsgJZpXc6mUNiDdEn4v5iJ/0 dZ5r3RTN86tInj2TudSNLppoDAk6vB6qtgr4AbaRsYkxcIfYGl7DK8HAVtfGP/EWVHuk /av34ewSu5soi0OEBuY2i0snX/9upjZJGnJJRWm28yOphwb5pFr3P1vCuZwHcMtNmmLh BbYspuZkt85bYJFMmuPGfL/dtb/b0ay4sTSUwaiJnqj0YW3jxTNuxysCiTDC2NRCpevR bl7RibuBevz1/EUvd/Sg8xuEV67l1K6kGjybtUte90XGnk0aDnxcE9s8FxoQpnPPWfYL 23iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XJ+aScgm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u13si20141135ejn.694.2020.12.28.06.50.25; Mon, 28 Dec 2020 06:50:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XJ+aScgm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504124AbgL1OsQ (ORCPT + 99 others); Mon, 28 Dec 2020 09:48:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:58226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389854AbgL1OWe (ORCPT ); Mon, 28 Dec 2020 09:22:34 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 347F822B2E; Mon, 28 Dec 2020 14:21:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165313; bh=Z33ymT/htmLNfqyeiWzePYAIqRjutd7RXpdwRGEqUpU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XJ+aScgmUfnzkeMJ/qrvhjgT8l+xnz9QgFS4hL9/vqHut+qF7QNmz97CqZjObYCx0 brrxoEmIl78GBYC7JMQVq1we4pwHPTNfjUUjhk/Wv35TbpRM7ACq6Jp3VO9zvv+RvM 3dX93xM91mxctk2w30pWTj2zRSECf/89FLM61Z0w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robert Buhren , Felicitas Hetzelt , Dan Carpenter , "Michael S. Tsirkin" , Jason Wang , Sasha Levin Subject: [PATCH 5.10 489/717] virtio_ring: Cut and paste bugs in vring_create_virtqueue_packed() Date: Mon, 28 Dec 2020 13:48:07 +0100 Message-Id: <20201228125044.392700333@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit ae93d8ea0fa701e84ab9df0db9fb60ec6c80d7b8 ] There is a copy and paste bug in the error handling of this code and it uses "ring_dma_addr" three times instead of "device_event_dma_addr" and "driver_event_dma_addr". Fixes: 1ce9e6055fa0 (" virtio_ring: introduce packed ring support") Reported-by: Robert Buhren Reported-by: Felicitas Hetzelt Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/X8pGRJlEzyn+04u2@mwanda Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Signed-off-by: Sasha Levin --- drivers/virtio/virtio_ring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index becc776979602..924b6b85376bd 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -1676,9 +1676,9 @@ err_desc_extra: err_desc_state: kfree(vq); err_vq: - vring_free_queue(vdev, event_size_in_bytes, device, ring_dma_addr); + vring_free_queue(vdev, event_size_in_bytes, device, device_event_dma_addr); err_device: - vring_free_queue(vdev, event_size_in_bytes, driver, ring_dma_addr); + vring_free_queue(vdev, event_size_in_bytes, driver, driver_event_dma_addr); err_driver: vring_free_queue(vdev, ring_size_in_bytes, ring, ring_dma_addr); err_ring: -- 2.27.0