Received: by 10.192.165.148 with SMTP id m20csp2469964imm; Sun, 22 Apr 2018 07:42:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+9nrideyKK0pjGLzxmVXX9rnhY6X81NnKJpb4sfoc4CbZnePNo+5ipQKGQgvsD9kOAKTIU X-Received: by 10.99.42.206 with SMTP id q197mr14607585pgq.60.1524408160348; Sun, 22 Apr 2018 07:42:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524408160; cv=none; d=google.com; s=arc-20160816; b=NlCRElEXua2MYJbDne27z8RQl/7tso0fPo2jiaIAeytrocjWG0Ktaa2LwiWY/jTE8h HkqcJQqEKb5k94RUCMhgooic1kHp4p7pRF2V4qai8twxhAAF0QDviKjNBmU0qCF1uT34 dfZ1QA4R81FpjQsfjRK6bCjIfvzGa4Y0hcGkMdFwy5crgolQ38db8FCbhIRSROd6IXt0 7WdzzHeIS1T4eZGBFBziXHJapqXYKNYNbj5d4K9cDEyJeB8Nf6frseiw6xSL7Xk+Oa0g t6oLQtkOAGeDlDeg5EKs3DXtcP0vpcVeSA8/dte6nAwRqChQwKaCF+qWqJvizRY+6HRY Ie8A== 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=qKUsjk+zymU0VcYPy3fuJUv3AJ2WBWbSIYqWR01jg5s=; b=HtH/YcoX/tSxgrddk9/K7Wiy8SP+CnucV6nyvaUlLcmwKJyNwgiL5onUFjpBQVLt3e pzC16MEQl/c5c3m7KX2p4Dl7TdOr7e3f8TrfcjJ/Q0BWlBPXPbOzG8Q/rdz8sXYD9L5E sTZFNR9XdaK9v+Cc4eZGulSoj599omwtfS9uKGsksCdAznNHZ322eB7DhAGnuyWppQ+C UYvtB856dq1DnNl5VCF5zkBkFs528qMF0YJ5xkplvzvW5DPFjKaOAA+9LJ69Cjy2H2Ti E8gzupmBvQHopsn54+Fk1bZbZp1F2rK5A0BUWN/YlgtgWqrmyrWcIbq3FMfHOLjXygJW wjOA== 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 w22-v6si9462940plq.115.2018.04.22.07.42.26; Sun, 22 Apr 2018 07:42:40 -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 S1757356AbeDVOl0 (ORCPT + 99 others); Sun, 22 Apr 2018 10:41:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58520 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757060AbeDVORo (ORCPT ); Sun, 22 Apr 2018 10:17:44 -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 CB0ACCD2; Sun, 22 Apr 2018 14:17:43 +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.4 58/97] iommu/vt-d: Fix a potential memory leak Date: Sun, 22 Apr 2018 15:53:36 +0200 Message-Id: <20180422135308.500756058@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135304.577223025@linuxfoundation.org> References: <20180422135304.577223025@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.4-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;