Received: by 10.223.164.202 with SMTP id h10csp543703wrb; Wed, 8 Nov 2017 22:32:28 -0800 (PST) X-Google-Smtp-Source: ABhQp+QdOlVozsK8x+8vgIoX6ftoCaZ5Bx/rXEY9G4P/SNEGbYFLkgxPjit44VnpJXY3nCVJaCCU X-Received: by 10.159.255.70 with SMTP id u6mr2841159pls.41.1510209148689; Wed, 08 Nov 2017 22:32:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510209148; cv=none; d=google.com; s=arc-20160816; b=c18Il9KgiwawCc4aKfqVM0XQ3eAAUf1JIsNvBLaPaIrE8ybt/DlCMY1BWc0Rrs250s /R7mluHcQ1/qfE4Hlh2vi1Xj6PWiFdCbVYwEa3VKz2gYSKKThkO1dOEI/nryI7YBLtwX Z3qJhtE0H9xRuNtbACBWDEdbo+RiCKCIBwG+TM4HO6gktqNJ/X6WRvYLbOv9HP4HDwgu FoGuEqRTZhupPNInm9hpRe1jd/Y8LFwB3hhfyFlEytn02YOcUXq1pUNLeqUSbqgs04La oM6zLlqKX2F+jI2gvQ4scIL4Qhp2EJvPyuDtTcGPxsHvF3nprjgu5duJpMhOu2U1PVSv R3Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=V7AmpUs7f83eYNoZqi5xck9kqWxqbDh0xf462yuNr8E=; b=REGpjta3TuzWiDZTm3exY6e9WKS/ZrMJlTXc2JlOwmD/uUl7iIHw161I37Xdu5p2uR bHhYVkyVdV6/mh3FKSeiaBTty3VGJyHF9Stq+7+rAcDYpls8zKO387mH8j/2yzK7NnXL /fQLdZPyDTofq1iO5NP/uVBDaTCPnnzF7fGp63e8q3d6KcJg01NpwGQk7IGBM2oLYKE+ KT6+/F+Yam8DS30ybgLiV430+A+H4cwUdTTX1UelvKYD3wtxyzFrrEmWfYZHGK1KBFFy RXz2q3u//7hPOJOGkmuF+IdSWxMDDdfVay6QwzrXlasDEyEx7MyoJpnpiFUqcKSy8+Ke +tXg== 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 n11si5180186pls.746.2017.11.08.22.32.16; Wed, 08 Nov 2017 22:32:28 -0800 (PST) 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 S1752502AbdKIGbA (ORCPT + 82 others); Thu, 9 Nov 2017 01:31:00 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:10039 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750979AbdKIGa7 (ORCPT ); Thu, 9 Nov 2017 01:30:59 -0500 Received: from 172.30.72.60 (EHLO DGGEMS412-HUB.china.huawei.com) ([172.30.72.60]) by dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DKP23640; Thu, 09 Nov 2017 14:30:50 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.361.1; Thu, 9 Nov 2017 14:30:42 +0800 From: Xiongfeng Wang To: CC: , , , , Subject: [PATCH] ACPI / utils: Fix memory leak on an error return path in acpi_evaluate_reference() Date: Thu, 9 Nov 2017 14:22:39 +0800 Message-ID: <1510208559-36069-1-git-send-email-wangxiongfeng2@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0204.5A03F61A.0153,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 431c2fde35965979028b0160fbed6b1c Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When package.count is larger than ACPI_MAS_HANDLES, buffer.pointer is not freed before the function returns AE_NO_MEMORY. Fix this possible memory leak by kfree'ing it. Signed-off-by: Xiongfeng Wang --- drivers/acpi/utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index b9d956c..9282549 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -355,6 +355,7 @@ } if (package->package.count > ACPI_MAX_HANDLES) { + kfree(package); return AE_NO_MEMORY; } list->count = package->package.count; -- 1.7.12.4 From 1583590229542953817@xxx Thu Nov 09 12:08:49 +0000 2017 X-GM-THRID: 1583063028193131710 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread