Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp275355pxm; Wed, 2 Mar 2022 15:10:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+4nrRF1SO8yx51Q872ZaojpkT7QF38UqkY3ndOX21nMHM0PeF+qustJSB5HVc2bGn2plb X-Received: by 2002:a05:6a00:2481:b0:4f4:2662:bb4b with SMTP id c1-20020a056a00248100b004f42662bb4bmr12658664pfv.49.1646262656466; Wed, 02 Mar 2022 15:10:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646262656; cv=none; d=google.com; s=arc-20160816; b=zINUOYF0Fhl8TU2g/fjgqAYrpHrYz9UqZ9ACUwHT2+6K9Sy1pcB4p7szBFw9bgHyCX NbsxNfwbJixj+QadR4ty9ZK2h/OIjn00a7tWxM6ejw73Jeuuj1otfRLVsBTT3ecaQQSE 6TGg9BOFsGYSVGrzfHZsWGhR7DikzAJ+qUAcsGWoCk+Ja+qITfPymPJ4oIzDTkC4Cme6 HvDxRJJL/rsrFhgE4kgmPn2GUHmb71vPzRriaGg9Gisq0wUEK6JHwD5kTtDQwZg05z/6 j23iRygfjXEd3Br+TVZWPqDjEQXPXNVNyQRkGQC/xWRIWl/We2nSKs0LjrIDEzN8LRf5 iMkQ== 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=C6KNp58WJw25Gqq/g2x7bv1Z1SERyWZpCzd+LWYptzA=; b=FLW4IMQKzvzCqh4VrPgmcQUM4nId9E+t3LZnw1RGlsI/ySVNHVWF9LDREa7ophJ1qp AJV9iqTL6v2kynul0BAj8nOYi8Ko6EnNKdZMUsp8Fbhr1T6H8lvUyoU2zbuNkFRWihmZ inFOibUyTOTDdXTNbR5DAc/fczPS5f69EShRHfXJ4jdV2VDlV8M8/JNzKGkl8jXPV1OS nJV/enfFP8Rq1cVCbMXcP8AilMMXYFDQVHb5Y9pxGxIaIT/nCKRz6d/+Vbn2qECu9ygR 6n8mvYHBkR9lZpjZ6pnfVoy7bH6p7qhWfjTQ/gLRXVaAx/yBIXAl20xXvHAhbMaZXvk7 lgOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=PhEWgWth; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z7-20020a655a47000000b00373dd4f7cd4si341560pgs.788.2022.03.02.15.10.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 15:10:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=PhEWgWth; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7253B108BD5; Wed, 2 Mar 2022 14:51:30 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240601AbiCBJpq (ORCPT + 99 others); Wed, 2 Mar 2022 04:45:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236773AbiCBJpl (ORCPT ); Wed, 2 Mar 2022 04:45:41 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D0363EF0F; Wed, 2 Mar 2022 01:44:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1646214281; bh=C6KNp58WJw25Gqq/g2x7bv1Z1SERyWZpCzd+LWYptzA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=PhEWgWthBFzxP/57lZlD6JQh2tCROKVGmBNuC+6J0MC/AbmySq5uupn8IZB5G8tDD uP4ZhPfEcTyuy4ngS+YhdJKE1hgE73dx+PzX2A9qKiL9YCQB6bBX9mNWREEHS06DFH aEA3Hxy6s/qgCa3rU8G1XpLFny8/tYNGeCP0dz/0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from Venus.fritz.box ([149.172.237.68]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MMXUD-1nf5XL2v1r-00JZGr; Wed, 02 Mar 2022 10:44:40 +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, Stefan Berger Subject: [PATCH v9 1/1] tpm: fix reference counting for struct tpm_chip Date: Wed, 2 Mar 2022 10:43:53 +0100 Message-Id: <20220302094353.3465-2-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220302094353.3465-1-LinoSanfilippo@gmx.de> References: <20220302094353.3465-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:Hq0i+WnnfUA1Teyrfoie5syUK83shLk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AOT0/pvUiTOt4hOpC2MmgUWDNI0pEage3ArjTLX2FhwthisqNfrZlB9nszl4e4tOsI GSnkYdfArqN1guY0a37zhgQJooUO5JQVcfn+bzqxtrp8NbV9m1QwP0cKPJI5CZAGTM1sA4Gs/ 4CzR+Uf9hcFT+w42dcU2ASHSZOERdZcA3gjhazdnriKMihmwl9L6uv7LQpt5YVhTCzKFDzHFy wWZNS8QgyPi6OKtNG+6XpQSOwLmRbJ8m5Pwp36MWGPJtiOrYDTI9DZermsyl4vfAfvkFGxfvw zG47yImBfilk4U= X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MIME_BASE64_TEXT, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 eGE0Cn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