Received: by 10.192.165.148 with SMTP id m20csp2486026imm; Sun, 22 Apr 2018 08:02:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx49j0GIc9N5Z3+X2wNWJb1YoVcf9nMqupVYUoIaPrqY+kIuPAEI+K0pkiqVdxNqm0zkpw8Lx X-Received: by 2002:a17:902:524:: with SMTP id 33-v6mr13489586plf.25.1524409345066; Sun, 22 Apr 2018 08:02:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524409344; cv=none; d=google.com; s=arc-20160816; b=gBqQGvWd1CyCvRsnF606ejakSXQxZzDIQa0xcbyuriXY44TgKDN6tseOwmu8I61TVm eQQkvwm5cqF7Rg0RRC6zCEIRorKjtA0eixTAS8mSrAXcAjmpHtAm7YgvLRYSTjcEcEQr 8XWhAcTK/7L8A3PvOgYhHb509l9POigBKlotepYN7AyWkG9UG+ej52qBheYqAI/+sYjw 7+B5E4MN2xCJZmKfDMJTeAYteR1cA7jHyaNyIn7Xvtqqybqc+Mh6iQJmg9GX4r/87Arq GPC7NQh7Y4DF40oGi8QjM4+nz1U4fcTavLb/SNS/9cZ0HueU4uYMs6XY0NvYgB9xGqMC 3DGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=NAmjKsgDjyiJgsVpxTK7M89+WJ4hfekd3KycCqbHd+g=; b=C++xZxFVFESob2k9oFUDf6k0IyOUo2mf7Ks11qJtDMy70I7t7cu3ipLhxyHVqLGUDn 2AzUBG93RsgmhYnJguAMZPuulDu7aL6pcc62b75S5C2bLwjtOmP3B9Ume7z1YmgdGtsr RO1TNJ/8KI3jjlrnJM5tAZuvQzuhB6zXiFft0tCX1rZWkVLL3avA802HUZv3t4wdmsiX wxgsFRlYuIxZPjE4jHhS93bF167El1/0Vpc82HxfgLqAJiIzQf9Q1riWsfjthGd91dud EvxfNGdmx3ZyHxZ0JGl0E5QT0P7VhpeOU3HwQgPJhmMO/4ZJ1UraQRDAtkrQwUEvdlWo qM6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bb4-v6si5296867plb.169.2018.04.22.08.02.11; Sun, 22 Apr 2018 08:02:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754066AbeDVO76 (ORCPT + 99 others); Sun, 22 Apr 2018 10:59:58 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55384 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756763AbeDVOM6 (ORCPT ); Sun, 22 Apr 2018 10:12:58 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CFF9FCC6; Sun, 22 Apr 2018 14:12:57 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ashok Raj , Jacob Pan , Lu Baolu , Joerg Roedel Subject: [PATCH 4.9 49/95] iommu/vt-d: Fix a potential memory leak Date: Sun, 22 Apr 2018 15:53:18 +0200 Message-Id: <20180422135212.418543419@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135210.432103639@linuxfoundation.org> References: <20180422135210.432103639@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lu Baolu commit bbe4b3af9d9e3172fb9aa1f8dcdfaedcb381fc64 upstream. A memory block was allocated in intel_svm_bind_mm() but never freed in a failure path. This patch fixes this by free it to avoid memory leakage. Cc: Ashok Raj Cc: Jacob Pan Cc: # v4.4+ Signed-off-by: Lu Baolu Fixes: 2f26e0a9c9860 ('iommu/vt-d: Add basic SVM PASID support') Signed-off-by: Joerg Roedel Signed-off-by: Greg Kroah-Hartman --- drivers/iommu/intel-svm.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/iommu/intel-svm.c +++ b/drivers/iommu/intel-svm.c @@ -389,6 +389,7 @@ int intel_svm_bind_mm(struct device *dev pasid_max - 1, GFP_KERNEL); if (ret < 0) { kfree(svm); + kfree(sdev); goto out; } svm->pasid = ret;