Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4583583pxu; Tue, 13 Oct 2020 01:53:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyH2Yri1kcaFLpyC3+ZsVJbab/OrEIJiHoGtDXQ0loDqUVL0cxB0QpraakRDHbLyZBKSZv X-Received: by 2002:aa7:dd11:: with SMTP id i17mr18800081edv.188.1602579233112; Tue, 13 Oct 2020 01:53:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602579233; cv=none; d=google.com; s=arc-20160816; b=U4f2eIru0zNm3lpIwXFRgaeVKkbF8nxfcniJiHsnKOtHtjZdlENsquwq5EN7aaKQzN kUHfV3GQM4v7IBvFiX2RpYj5QVkuoji/YF7uyzX6XJ/r44Y4aFV/ZDsusm9nBQoBwPwk CFaXA2JfoHtDS2ciPNyjdOtY/mDb6FuFnI5c2GpGVEP/a1Y1nXmkhmzuQIeLxsgwFL6K jSFyrAhZ3c8zmoMKVq9yFMe5pF4DuOrv9FZz6/qo/MbjSfRkF9fMZUmuh560GpELRvCL ZeL997WMuVB4WgwWMeXtkuTiSdJc/EjrGXXWVFoTXDBzYIkp6gT9D+nUcsi30Lg6VUgL KDyw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2fcLQ3UmNP2Kq9r2/2VquVythd1sDRM92UF5q6lULHA=; b=aRm/vDgly0EJrPLT7DbbN6PDtk6mmjoC/lfpFLpu52GlLDiX1ydQCWOc4YOKGI97av K9vdiayf26Vh/paMJAH1BgBNADugyfXRqdKH9QJ7Sae+1HJbrodVNdiG+dZbdatRWzP2 vfd2OlDkVwyjmm8pHmglVI06WvcJV2mSs+61ejl4Nh+bDhBn/7jWaNpZ5/soym2nqIoH C5RxQIdZACiPGZuusmM7YhGtfklmqOHiy1PN5l3LOq2ic54zvN2oxGrx2BiEdePwlrkm AQN+T3xvrgBklsnybpKVEb9MPA2fTI1eR8/I/h0xqgSB7JFV4s9vP+0d/H3cipzdzYfC QC+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WJXwbpDh; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o14si14005644edq.11.2020.10.13.01.53.30; Tue, 13 Oct 2020 01:53:53 -0700 (PDT) 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=@kernel.org header.s=default header.b=WJXwbpDh; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389030AbgJLTDD (ORCPT + 99 others); Mon, 12 Oct 2020 15:03:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:52368 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388390AbgJLTDC (ORCPT ); Mon, 12 Oct 2020 15:03:02 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 68C8921582; Mon, 12 Oct 2020 19:02:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602529380; bh=BYbbrFgph4SjLhGZw4fINy6lmVuypEQSdT6k9nzquQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WJXwbpDh/qNsdNwUz5wCM7EnSLBrpIEXEki7sMBgNrJrL36+0sYlnYl9RT8Jv6KkF iCm535JwpGIO3GNbGqN2mOGk7rnCXf+4VcapVjoRk1cvd9IkpaQiXB1urugrVRyy96 aUxD2NQIwyzJDe/yVpMSQulhzQ7nwaEEaRCjqVKM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mike Christie , "Michael S . Tsirkin" , Jason Wang , Sasha Levin , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.8 16/24] vhost vdpa: fix vhost_vdpa_open error handling Date: Mon, 12 Oct 2020 15:02:31 -0400 Message-Id: <20201012190239.3279198-16-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201012190239.3279198-1-sashal@kernel.org> References: <20201012190239.3279198-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-kernel@vger.kernel.org From: Mike Christie [ Upstream commit 37787e9f81e2e586b526ff5c29c94e4f41513e80 ] We must free the vqs array in the open failure path, because vhost_vdpa_release will not be called. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/1600712588-9514-2-git-send-email-michael.christie@oracle.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Signed-off-by: Sasha Levin --- drivers/vhost/vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index a54b60d6623f0..13cdf38f8578a 100644 --- a/drivers/vhost/vdpa.c +++ b/drivers/vhost/vdpa.c @@ -760,6 +760,7 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep) err_init_iotlb: vhost_dev_cleanup(&v->vdev); + kfree(vqs); err: atomic_dec(&v->opened); return r; -- 2.25.1