Received: by 10.192.165.148 with SMTP id m20csp2431856imm; Sun, 22 Apr 2018 07:01:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx49t3TJB/q298YvdBa0nTs9Qe6JP3lC8LEdvtFqwkBFIlZjEqfkQj6e+8sJCRvSjk7BJkyN3 X-Received: by 10.99.148.1 with SMTP id m1mr14312520pge.140.1524405690736; Sun, 22 Apr 2018 07:01:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524405690; cv=none; d=google.com; s=arc-20160816; b=EX70Bv6AlCEpwhy5cRqYTO31v6dobiKlV4ZtZt3yXq6U2RvpDJPBz6PU1rMXXBdemd jTRJV99cpHHJFRuK/H2Ctw9cpob0KTagtBxP09iDFvdquo5CetpVpWYXTvkSk7H6E1jP AtWdzGZcDGiloBz06HokFN5YCbKjSrAFpzKRfpDQAfgey8Y34+JC5LOvV/Tvhxu+iMmG 0+lx+Dtpy8U2M3UVC6AuSWHWuwxaamA31iRaqmn9bk/D7ug6xKO3+8UK4piynRKekf3Q BR78BP3J5sqQu/c3+3tcj8trbsGoR1yuHVP7GncYy7X28rAyps09Awa0M9zQ4Xy6Tsrk +fhQ== 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=UMUnq+KbPTAvFfwcxPtecYCix0C0OrMKdejaMuIvpwo=; b=ny/f0qPh519KOBEK8BHezRsbU+FbrLtUHh4cIt4RbIrmQVPyUQf3m71vJPYeedmYi6 2INjbM8c4sn78b1hTzvICUzm7qOQukIMlisnVWrQybvdkiDT28WhOo/oHQ0f2VlGJdZg MNaxHL6MYSb4fcWHKmyFfgSD1kPnkZly0CbRMNsNrAgf7gT7kSwj+Da/nPmiK5ynD1P2 XJ02llIfJhQ3wHNXfMOoysXBZENWleBa93HwVHiuzJA3l6gy1Ao9x6ec+jrykhwo4muF athJHMGs4k7YTP9iVYU2ordWvVJsl4Z7RjpwJanf/Go5z/1r4c2VNqAag3Q1FBKayRdY GrnQ== 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 g18-v6si9647868plo.586.2018.04.22.07.01.16; Sun, 22 Apr 2018 07:01:30 -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 S1754514AbeDVOAR (ORCPT + 99 others); Sun, 22 Apr 2018 10:00:17 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47242 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754058AbeDVOAK (ORCPT ); Sun, 22 Apr 2018 10:00:10 -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 2B717941; Sun, 22 Apr 2018 14:00:10 +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.16 130/196] iommu/vt-d: Fix a potential memory leak Date: Sun, 22 Apr 2018 15:52:30 +0200 Message-Id: <20180422135110.974213585@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@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.16-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 @@ -396,6 +396,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;