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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B7A0C76196 for ; Mon, 20 Mar 2023 06:33:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229794AbjCTGdI (ORCPT ); Mon, 20 Mar 2023 02:33:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbjCTGdF (ORCPT ); Mon, 20 Mar 2023 02:33:05 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53AA722A32; Sun, 19 Mar 2023 23:32:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679293964; x=1710829964; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=Fd/G5KCuQQujS9KXOruku3RueXzTt7Ru/BXGSsi5VuU=; b=MzR4KjWLvjzXF8U3Fx5/NcuSwdh0Ops90HfJ4nn8KMmbxQz6I1sxNlCi 83pzo8q718jVgqKCpWSFwn/7ZqptiXXJtxsvbkgm/9WiZVAy5zohC6q2R tgKf/ZIm2cFWYnWhK9Ud3xHllVe2t9AaJheop3se9a4tmNbHWDEOrnBxP ZIItAfuYUtnwZ7nT68V1nTyIe5Z0IqisUwX1G/WHeNVeYI9vibkGegS20 baHw4WCiqEoaeyEEOrEkj2/K9gDn7hIb9HMW9lPUatdBExnyfR1/euzR7 4F7olNilsn96bpuunHlSR/PKOmB/1pykCggqoTKOQvixlZjJeF3xhJGwW g==; X-IronPort-AV: E=McAfee;i="6600,9927,10654"; a="337301492" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="337301492" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2023 23:32:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10654"; a="631009703" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="631009703" Received: from isasover-mobl.ger.corp.intel.com ([10.209.180.176]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2023 23:32:39 -0700 Message-ID: <8207eb83d6b2488cfb524befdbb7184c8503f997.camel@linux.intel.com> Subject: Re: [PATCH linux-next v2 1/3] platform/x86/intel/tpmi: Fix double free in tpmi_create_device() From: srinivas pandruvada To: Dongliang Mu , Hans de Goede , Mark Gross Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sun, 19 Mar 2023 23:32:37 -0700 In-Reply-To: <3c2f9226-8741-4e51-241f-5dbac45cc794@hust.edu.cn> References: <20230309040107.534716-1-dzm91@hust.edu.cn> <20230309040107.534716-2-dzm91@hust.edu.cn> <559654bbef8483fcd53458824f23814236b0c9e0.camel@linux.intel.com> <40d7cb19-5712-9754-b7bd-2b582055c929@hust.edu.cn> <41c9e613d718095e31674f625f48c60fe493d658.camel@linux.intel.com> <3c2f9226-8741-4e51-241f-5dbac45cc794@hust.edu.cn> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base64 User-Agent: Evolution 3.44.4-0ubuntu1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gTW9uLCAyMDIzLTAzLTIwIGF0IDEwOjQzICswODAwLCBEb25nbGlhbmcgTXUgd3JvdGU6Cj4g Cj4gT24gMjAyMy8zLzE3IDE4OjI3LCBzcmluaXZhcyBwYW5kcnV2YWRhIHdyb3RlOgo+ID4gSGkg RG9uZ2xpYW5nLAo+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