From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5466BC11F68 for ; Sat, 10 Jul 2021 23:52:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3D3C961422 for ; Sat, 10 Jul 2021 23:52:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233504AbhGJXyp (ORCPT ); Sat, 10 Jul 2021 19:54:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:41208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232996AbhGJXxz (ORCPT ); Sat, 10 Jul 2021 19:53:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8896C613E8; Sat, 10 Jul 2021 23:51:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625961062; bh=7XQ3Ut6MFTQjVKXo1NJiJp/Vt5b8y90oKq9E7EL1Kis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nRC875A1H6RbyvQH2cjd0yKUguh1LpDc1Ex9zd9MOxY491jhDzDTqsuQi12KQbmU4 muAajvh44EP+WGS6Eke9WSZ6aW/9/BxAlDIWmt7kVdpl0ShBXURKl0FhVhDDHKpQJu iR81AIeABEnp44kFzLWFQDwJVvmCJkuF/mndbddlA9aGY154IlDfV7SUxmc+sSO6ub zOV8WLyof3n1XGwSVEHmOjQfNy14/T/dYDB4zEVMFLTULurlwXRORkVpkN9gZWAXvc 3KsMbnexZnrQokFP2THmOaPUfQwa7GT+HLH6WPyWGkzcbS0NNMW7iki6EFmJf3Kioz V4gA0tZwPQu/A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Xie Yongji , Jason Wang , "Michael S . Tsirkin" , Sasha Levin , virtualization@lists.linux-foundation.org, linux-block@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 34/37] virtio-blk: Fix memory leak among suspend/resume procedure Date: Sat, 10 Jul 2021 19:50:12 -0400 Message-Id: <20210710235016.3221124-34-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710235016.3221124-1-sashal@kernel.org> References: <20210710235016.3221124-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org From: Xie Yongji [ Upstream commit b71ba22e7c6c6b279c66f53ee7818709774efa1f ] The vblk->vqs should be freed before we call init_vqs() in virtblk_restore(). Signed-off-by: Xie Yongji Link: https://lore.kernel.org/r/20210517084332.280-1-xieyongji@bytedance.com Acked-by: Jason Wang Signed-off-by: Michael S. Tsirkin Signed-off-by: Sasha Levin --- drivers/block/virtio_blk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index a314b9382442..42acf9587ef3 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -946,6 +946,8 @@ static int virtblk_freeze(struct virtio_device *vdev) blk_mq_quiesce_queue(vblk->disk->queue); vdev->config->del_vqs(vdev); + kfree(vblk->vqs); + return 0; } -- 2.30.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B6A0C07E9B for ; Sat, 10 Jul 2021 23:51:08 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C6B20613B6 for ; Sat, 10 Jul 2021 23:51:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C6B20613B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=virtualization-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 9F7C1400E8; Sat, 10 Jul 2021 23:51:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ft_Do315EMQw; Sat, 10 Jul 2021 23:51:06 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 90993400AB; Sat, 10 Jul 2021 23:51:05 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6064AC0010; Sat, 10 Jul 2021 23:51:05 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id EBCAFC000E for ; Sat, 10 Jul 2021 23:51:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id E819D83AB7 for ; Sat, 10 Jul 2021 23:51:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Qr0Zy1x5QbDK for ; Sat, 10 Jul 2021 23:51:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp1.osuosl.org (Postfix) with ESMTPS id E47F683AB5 for ; Sat, 10 Jul 2021 23:51:02 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 8896C613E8; Sat, 10 Jul 2021 23:51:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625961062; bh=7XQ3Ut6MFTQjVKXo1NJiJp/Vt5b8y90oKq9E7EL1Kis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nRC875A1H6RbyvQH2cjd0yKUguh1LpDc1Ex9zd9MOxY491jhDzDTqsuQi12KQbmU4 muAajvh44EP+WGS6Eke9WSZ6aW/9/BxAlDIWmt7kVdpl0ShBXURKl0FhVhDDHKpQJu iR81AIeABEnp44kFzLWFQDwJVvmCJkuF/mndbddlA9aGY154IlDfV7SUxmc+sSO6ub zOV8WLyof3n1XGwSVEHmOjQfNy14/T/dYDB4zEVMFLTULurlwXRORkVpkN9gZWAXvc 3KsMbnexZnrQokFP2THmOaPUfQwa7GT+HLH6WPyWGkzcbS0NNMW7iki6EFmJf3Kioz V4gA0tZwPQu/A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 34/37] virtio-blk: Fix memory leak among suspend/resume procedure Date: Sat, 10 Jul 2021 19:50:12 -0400 Message-Id: <20210710235016.3221124-34-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710235016.3221124-1-sashal@kernel.org> References: <20210710235016.3221124-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Cc: Sasha Levin , "Michael S . Tsirkin" , virtualization@lists.linux-foundation.org, linux-block@vger.kernel.org, Xie Yongji X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" From: Xie Yongji [ Upstream commit b71ba22e7c6c6b279c66f53ee7818709774efa1f ] The vblk->vqs should be freed before we call init_vqs() in virtblk_restore(). Signed-off-by: Xie Yongji Link: https://lore.kernel.org/r/20210517084332.280-1-xieyongji@bytedance.com Acked-by: Jason Wang Signed-off-by: Michael S. Tsirkin Signed-off-by: Sasha Levin --- drivers/block/virtio_blk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index a314b9382442..42acf9587ef3 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -946,6 +946,8 @@ static int virtblk_freeze(struct virtio_device *vdev) blk_mq_quiesce_queue(vblk->disk->queue); vdev->config->del_vqs(vdev); + kfree(vblk->vqs); + return 0; } -- 2.30.2 _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization