From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 685F5C433EF for ; Thu, 24 Mar 2022 09:35:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 03D7210E861; Thu, 24 Mar 2022 09:35:50 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id A64FB10E849; Thu, 24 Mar 2022 09:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648114548; x=1679650548; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=ZCLxOEX/FkYbf6RtVxN2iY0TKX42gsdgqedL72ORiss=; b=kV/fOy38ewcx4vI6poqsZSOjF0CcJL73SaRnM+rsCM2IrycUjttit0u8 EennnVixf3Od1F7+D80QqbB0uBK6py+RkjyqD3WHGtIcvhM58qnOTtqP8 RjG1zIhGAmNP32E5XrtVGX0U+z7Yu9E9O2Jc0BgfIH4a+uP/usDM0/vlU FPcGwvWsQ3Gd3PX9sycOxPKnRcqkLLYIRxnPalsiVX5ngH2QOgkYQzg0s yc++aXwWHzsYSkozgWvNlDE3jTek6GfQDFQSsuPylVDj403bs6MG7rFGR NgRZHGJX5Nyz9wKiVs8dkLonvu4NoNds8ZL0JY/GqueePp0fZAk+1JSMZ g==; X-IronPort-AV: E=McAfee;i="6200,9189,10295"; a="258518045" X-IronPort-AV: E=Sophos;i="5.90,206,1643702400"; d="scan'208";a="258518045" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2022 02:35:47 -0700 X-IronPort-AV: E=Sophos;i="5.90,206,1643702400"; d="scan'208";a="561300084" Received: from nirmoyda-mobl.ger.corp.intel.com (HELO [10.252.56.159]) ([10.252.56.159]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2022 02:35:46 -0700 Message-ID: Date: Thu, 24 Mar 2022 10:35:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US To: Daniele Ceraolo Spurio , intel-gfx@lists.freedesktop.org References: <20220324000439.2370440-1-daniele.ceraolospurio@intel.com> From: "Das, Nirmoy" In-Reply-To: <20220324000439.2370440-1-daniele.ceraolospurio@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Intel-gfx] [PATCH] drm/i915/guc: Correctly free guc capture struct on error X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, Alan Previn Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Reviewed-by: Nirmoy Das On 3/24/2022 1:04 AM, Daniele Ceraolo Spurio wrote: > On error the "new" allocation is not freed, so add the required kfree. > > Fixes: 247f8071d5893 ("drm/i915/guc: Pre-allocate output nodes for extraction") > Signed-off-by: Daniele Ceraolo Spurio > Cc: Alan Previn > Cc: John Harrison > --- > drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c > index afdcbe63e9eb1..c4e25966d3e9f 100644 > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c > @@ -1040,6 +1040,7 @@ guc_capture_alloc_one_node(struct intel_guc *guc) > if (!new->reginfo[i].regs) { > while (i) > kfree(new->reginfo[--i].regs); > + kfree(new); > return NULL; > } > }