Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2695735ybl; Mon, 19 Aug 2019 06:13:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyd/nW2J5KlwkLdLNjiclaeqqdbXSRiODeX86ijqqOt9DL2ZrbZF6CWAbWi2GHXzNHMcX60 X-Received: by 2002:a17:90a:bf91:: with SMTP id d17mr13767423pjs.111.1566220436963; Mon, 19 Aug 2019 06:13:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566220436; cv=none; d=google.com; s=arc-20160816; b=pEeQ09mWrgJgVEz6OveTBox2vw8unuCRClcYKBdmi7GmQYNCPN+QccokAajylTGtbi Rmn0SaW2BQPvmGm7n8jKpl6YG+Bc9c+DGMgKCVluiqHTHMeefBe1rNZB49HFWlTGodDY qSf4HDgpat20E4cPSK2MEactA5F4fewcsRqRYDdkKTplhOH/mvbfGkLDvXl+rYaB7lM9 5mOieB16y9MbHIDS8G5CWzgLc/wQu6YXnBIhnQAAElwFljt1XIzW4znp/fKMPozHifaQ +hbbxYfJD8HlGAx5jJI+nJby7uJkyHj672qK6/JUV9IBpB+YDqFwfbXQI3a56YTt/R04 dpJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=HwcuEBKc+r+JVid+Ugv7qrTGWOHtVvDCLUkDGx8x4x4=; b=cVprq8UZ+SBHOLUzEsF266AD7M9IasjmFkO6bjj9IaBj368RUPDrX01cfHu6e9fl6u 6JbYF8gp59OgeDq2dOXC4ezXGz1pYQx5jVmF/hCFRqilSp0r7Y/b05C6wCCODjkhS23y 62uCfDMiWM3c0+JSFA5Jf60XcRkGUAUu/XBdwz/jhEjG+fADjYkURr4lnPSKKMGvBRfZ mpYM2HOr5pZ8GxeQa8XMxEGRfgeZtcBTZmyaDTsiJbdPu0w9udZgS9sq7RxckU6Eb9bV u5SyChG3/5Fla0WL2HOiEF03kuN3MjTI77E0t+rEgpHd0xHyHXbq1WC6cOEW1UmbiQO0 nbyw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9si9910770pgv.225.2019.08.19.06.13.41; Mon, 19 Aug 2019 06:13:56 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727677AbfHSNLc (ORCPT + 99 others); Mon, 19 Aug 2019 09:11:32 -0400 Received: from mga03.intel.com ([134.134.136.65]:21677 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727301AbfHSNLb (ORCPT ); Mon, 19 Aug 2019 09:11:31 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Aug 2019 06:11:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,403,1559545200"; d="scan'208";a="168746706" Received: from ddalessa-mobl.amr.corp.intel.com (HELO [10.254.207.195]) ([10.254.207.195]) by orsmga007.jf.intel.com with ESMTP; 19 Aug 2019 06:11:29 -0700 Subject: Re: [PATCH] infiniband: hfi1: fix memory leaks To: Wenwen Wang Cc: Mike Marciniszyn , Doug Ledford , Jason Gunthorpe , "open list:HFI1 DRIVER" , open list References: <1566154486-3713-1-git-send-email-wenwen@cs.uga.edu> From: Dennis Dalessandro Message-ID: Date: Mon, 19 Aug 2019 09:11:29 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1566154486-3713-1-git-send-email-wenwen@cs.uga.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/18/2019 2:54 PM, Wenwen Wang wrote: > In fault_opcodes_write(), 'data' is allocated through kcalloc(). However, > it is not deallocated in the following execution if an error occurs, > leading to memory leaks. To fix this issue, introduce the 'free_data' label > to free 'data' before returning the error. > > Signed-off-by: Wenwen Wang Acked-by: Dennis Dalessandro