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 2689BC74A5B for ; Fri, 17 Mar 2023 10:28:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230329AbjCQK2T (ORCPT ); Fri, 17 Mar 2023 06:28:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230043AbjCQK2A (ORCPT ); Fri, 17 Mar 2023 06:28:00 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 325E6E503A; Fri, 17 Mar 2023 03:27:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679048870; x=1710584870; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=b3uJJp2j4SXI+kVglBWomd4R/1qVyPfgtkR2mvNBq5I=; b=iSWJIB6B1MJfTh7sNk2F5SI6b5WWdGAEtXjwqnSgxK67/smdEjh8/mkx w/4Mz8B+Cvl52luqEgn/Jbl8QI4tkhRX7aJz61LSEHVm/U6IRq6sOYhAP XTwPVd1v3xlgiB3yzwo8M44ha00yPu4P8Pu4zXSBNfbdorGRQkgNp2d0Y m1e8h5YwReReanUcuBlRVwdnv0EHqYoNZ4TBYiHYSpHTSD2NPV2/Y01jf YUOLI6MTOQ1B0HmXXtSNcCXBvWc/gTuBH8zQxRqsRTwypWqRCzZD1g+LF +2dtC/B4R6FB3dfQs3RxPASPWmvgFtcrd8qRV9j0dENyZ0MQQ/nX4M9PZ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10651"; a="424502773" X-IronPort-AV: E=Sophos;i="5.98,268,1673942400"; d="scan'208";a="424502773" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2023 03:27:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10651"; a="680259233" X-IronPort-AV: E=Sophos;i="5.98,268,1673942400"; d="scan'208";a="680259233" Received: from yeonbokl-mobl1.amr.corp.intel.com ([10.212.99.82]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2023 03:27:48 -0700 Message-ID: <41c9e613d718095e31674f625f48c60fe493d658.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: Fri, 17 Mar 2023 03:27:47 -0700 In-Reply-To: <40d7cb19-5712-9754-b7bd-2b582055c929@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> 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 SGkgRG9uZ2xpYW5nLAoKPiAKLi4uCi4uLgoKCj4gSGkgU3Jpbml2YXMgYW5kIEhhbnMsCj4gCj4g SG93IGFib3V0IGZvbGRpbmcgdGhlc2UgdGhyZWUgcGF0Y2hlcyBpbnRvIG9uZSBwYXRjaCBhbmQg cmVzZW5kIGEgdjMKPiBwYXRjaD8KPiAKPiBUaGlzIHdpbGwgZ2V0IGFsbCBwZW9wbGUgdG9n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