Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3431383pxm; Mon, 28 Feb 2022 20:29:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyB181sl2G4LIH1Zf0s4BZ4ZnCwjS3JxeKEtr9ug3FblRhENMYcxcLsrDfQc1DNprzRwrT7 X-Received: by 2002:a05:6402:1342:b0:413:4bf6:9877 with SMTP id y2-20020a056402134200b004134bf69877mr22659328edw.212.1646108985952; Mon, 28 Feb 2022 20:29:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646108985; cv=none; d=google.com; s=arc-20160816; b=DikhZexULyA0rBj8m+zVizqOTajAg03LWJqI0MbrL2s9X/XTGz1EUKJzmEkZSovrpO cvHX+5rhMlk9S9waZTuuvNgIlGEJeSrE0nhoYdb00/293BWcv7FGoI/6aDK9uBgeiltG R5mG3pt4MQggddKheU0/RT576FKB/0+4kghsCCfRygTx+saPfUXpW21FYui9ZMoq811O MVYtmenCMQXLarQi1R0BepGz6qy6rmkx5EvpBr6az5PbLR8P3+eNbE6NvNXN/a4XKgYW KpKAbdLpjcS4yitis4msWe2h7iaHo2fLoa85KxjhKtooDKIkfJ4QpLNwPTah6aZW0CDy mBzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+Q3cSGAR3RfDzojYDj03zNV/SID4W3snlYJrXb5ASuQ=; b=PIi+U9qdpP/4g016sp1eP33EWogzLVUipNH55MMyw+V4fH+Ii1DQ4o9tyXAbmZTgLS tDK0MKYdy4NxxIVUXNG6oF/j0ZV8CHr1XrOgb5y2ekeSciDhV5QtAPCGE2f2kA3l3/E/ Sjkd2SxWph4LwO/WLE7pa1jrRtHNe2FHt0bq66o5PBiSo/KLvGn/BbyCbuweU2DCcMGN wMC0mB/2tKvfsXKFboRzo0W/YExQRqRapfq7FruV+gCG5OuLGXbDXcLD4JHIprXQqnaC JEF1edBMJHYafDJ3Vs3s7raDdtRcruc1fZw+pHoTu/bOsda9j4BijmBQaMdMsYACxIcB Fppg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=hkV8T3y3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k3-20020a1709061c0300b006d6e48e3b9dsi580297ejg.475.2022.02.28.20.29.23; Mon, 28 Feb 2022 20:29:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=hkV8T3y3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230253AbiCACWe (ORCPT + 99 others); Mon, 28 Feb 2022 21:22:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230140AbiCACWc (ORCPT ); Mon, 28 Feb 2022 21:22:32 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F8D8102B; Mon, 28 Feb 2022 18:21:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1646101296; bh=+Q3cSGAR3RfDzojYDj03zNV/SID4W3snlYJrXb5ASuQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=hkV8T3y383Ep0nUvzczZi99tG8PBpyiGBds1695Hg4up0oE3/QOqNBkdCLccbsqSu 2MaUA5Oo1yjgdx7K9nOjo0uulzcAm/AQLlVK+SZk/4WOu/v0wQ4OwA8EwLSLphUL4s dFfeVp85s+u9zq1dIeCgHI424weNmzY3j5DJhol4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from Venus.fritz.box ([149.172.237.68]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MplXz-1nyoyj1cg1-00q991; Tue, 01 Mar 2022 03:21:36 +0100 From: Lino Sanfilippo To: peterhuewe@gmx.de, jarkko@kernel.org, jgg@ziepe.ca Cc: stefanb@linux.vnet.ibm.com, James.Bottomley@hansenpartnership.com, David.Laight@ACULAB.COM, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, p.rosenberger@kunbus.com, LinoSanfilippo@gmx.de, Lino Sanfilippo , stable@vger.kernel.org Subject: [PATCH v8 1/1] tpm: fix reference counting for struct tpm_chip Date: Tue, 1 Mar 2022 03:21:08 +0100 Message-Id: <20220301022108.30310-2-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220301022108.30310-1-LinoSanfilippo@gmx.de> References: <20220301022108.30310-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:YF/zRSEc0lP8NrXiVplO4ZH1yrwQNtJI9prkM9SI3sP2HiU24bk DVyHN10vbk8k3qW3GaxY8gRQlQoq0empbSUsR9E3gyZSDcCxNDT6wYUKrjziK5UhpyNJ3oB xjpm3AzRfUMKkpF979BerlSHJBFJW4gruFFKUGlIQRI0u0d5C5v8/c5+tL/ZFVZQzQqQW43 m/NNJIKHbw6X5WgPx99rw== X-UI-Out-Filterresults: notjunk:1;V03:K0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4KCt5EgNSC3DeDs7Ks1rfU+TZPIR92fFnPrIhf2x2D0jPMzDINI8lNX+g lLVrCuOTKMSmwo= X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,MIME_BASE64_TEXT,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RnJvbTogTGlubyBTYW5maWxpcHBvIDxsLnNhbmZpbGlwcG9Aa3VuYnVzLmNvbT4KClRoZSBmb2xs b3dpbmcgc2VxdWVuY2Ugb2Ygb3BlcmF0aW9ucyByZXN1bHRzIGluIGEgcmVmY291bnQgd2Fybmlu ZzoKCjEuIE9wZW4gZGV2aWNlIC9kZXYvdHBtcm0uCjIuIFJlbW92ZSBtb2R1bGUgdHBtX3Rpc19z cGkuCjMuIFdyaXRlIGEgVFBNIGNvbW1hbmQgdG8gdGhlIGZpbGUgZGVzY3JpcHRvciBvcGVuZWQg YXQgc3RlcCAxLgoKLS0tLS0tLS0tLS0tWyBjdXQgaGVyZSBdLS0tLS0tLS0tLS0tCldBUk5JTkc6 IENQVTogMyBQSUQ6IDExNjEgYXQgbGliL3JlZmNvdW50LmM6MjUga29iamVjdF9nZXQrMHhhMC8w eGE0CnJlZmNvdW50X3Q6IGFkZGl0aW9uIG9uIDA7IHVzZS1hZnRlci1mcmVlLgpNb2R1bGVzIGxp bmtlZCBpbjogdHBtX3Rpc19zcGkgdHBtX3Rpc19jb3JlIHRwbSBtZGlvX2JjbV91bmltYWMgYnJj bWZtYWMKc2hhMjU2X2dlbmVyaWMgbGlic2hhMjU2IHNoYTI1Nl9hcm0gaGNpX3VhcnQgYnRiY20g Ymx1ZXRvb3RoIGNmZzgw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