Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp421209pxb; Fri, 15 Jan 2021 17:27:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9eRP8Dn+hcQ6Ip6TtuoxbrRQJIYU6R5xQ+881VK0/cC8iXMbHJgjcgZUkVOQAl7RZ51+M X-Received: by 2002:a17:906:3a0e:: with SMTP id z14mr2948706eje.285.1610760439696; Fri, 15 Jan 2021 17:27:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610760439; cv=none; d=google.com; s=arc-20160816; b=c1+kM5x/lTcACuQx3ufoXX5/tTspk1PsZzX3dun7nm79HBJ47a9pf6yNUf/NalWrUY CgarouVcZTO8wkOBMePJlyyzRwEoe2WG09MM4dsD5dKVSdxfMVEPC+p5h3VCRNCudcGq PffM9OZ/OLx0XlTROQ1BhPWMpNqOIRaKzBSc7vcpnl06Vff3zLgY9dwcJupxoz4VJl3A FoSvHtEWiag8haqZn+ccEQ0Cb9esLrJ5bq8gRbLCsVac6BAV/FwAXEQVF0Oz6m2QZfz9 o4IDnoMn/Q9FvUVZMs74ORYFxmgWlBrfEE1kJlNY75Cg+akO7/XS+pPDY/W5d51B4lJA FsJg== 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=tq8QTJr7FVAXyroHGXtKshh6wNZD9AmK0U3KQjT18TU=; b=1Cfn0T1dBlRpSUcZ/kZhyoOpzOCs9Nn4SnoSdPlnXOjwa0zoH9d9hK40gjG0uexFyq U9h5tQ2BwutMhgRr11blHPFFaaMiGsiJubSCJGJ0uVj/3lMoVR53/+nGrO7MmeSV0nhF TlI5iaE+ctK2/V+cda85foYhqkUSeuymlVMqSLukQ65eEKMBv1VqYfkneXeu1QxmorAy BQi97ZHafntP3NuOVA9GrcIZA4SD1BvQcyTpMVQ/Q3GxOG/YWR7I9og+W3Pi/Kg9BIW+ tJdrQgZYJBAdnXZc7D8LB2DROF/uv4xKFXOzwgQgSz6wN3Y9Udnl+8XfE6nL/tBPQRsj KtFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=VgBnWxIT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r9si4313978ejb.411.2021.01.15.17.26.56; Fri, 15 Jan 2021 17:27:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=VgBnWxIT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728694AbhAPBZW (ORCPT + 99 others); Fri, 15 Jan 2021 20:25:22 -0500 Received: from mout.gmx.net ([212.227.15.19]:43693 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbhAPBZR (ORCPT ); Fri, 15 Jan 2021 20:25:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1610760218; bh=tq8QTJr7FVAXyroHGXtKshh6wNZD9AmK0U3KQjT18TU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=VgBnWxITeHD5Z57wIu5MXk8e6jbXnVRZP5ghO5L32k9l1U+QR08v6ruPp4EmgX+WL NT2d2RRMazqlcBrNqcZbyUdYoaQYyM/dVb4Vr2qgrpcw24OA+cuPpWZSJS6cGsjOdB rUepKvw9G+x/hTuvGR5l4ozfLx+2K+5wKXK+bM/Y= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from Venus.fritz.box ([78.42.220.31]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M4axg-1l18oR3cMo-001iFL; Sat, 16 Jan 2021 02:23:37 +0100 From: Lino Sanfilippo To: peterhuewe@gmx.de, jarkko@kernel.org Cc: jgg@ziepe.ca, stefanb@linux.vnet.ibm.com, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, LinoSanfilippo@gmx.de, p.rosenberger@kunbus.com, Lino Sanfilippo Subject: [PATCH 2/4] tpm: fix reference counting for struct tpm_chip Date: Sat, 16 Jan 2021 02:22:39 +0100 Message-Id: <1610760161-21982-3-git-send-email-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1610760161-21982-1-git-send-email-LinoSanfilippo@gmx.de> References: <1610760161-21982-1-git-send-email-LinoSanfilippo@gmx.de> MIME-Version: 1.0 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:G6YcRh6v/Z6d8dLSkqTxXX86jQMGH75jC4Fl1XEEAEoXAC8GvCI doHDpkxhYhTw38FQQTuy54VH6sn4+47tO9IqtbIUm3FiTVpLV63GWgAOvX1XY8cbw08G34c ZQnODQ/0gMoxP6K3jk28fxApiTCn88UqZm4ywWy+UPJZPu75kWuEOa+GB7EmClsrkVyHfB5 J/s2KAivpzrBAutzEbsSQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:IoeNB7ZY4t0=:R2ZgnRWp63yb7mADHsGrQn Wj955TD8pHyrdxOT/uCP7roq43GKCod0w015eaWLoTlOLAdCOT6gCBku6ZGoapf1+x1R/M5Ov WaG/pzk0TJwd59RD191ineo6rA+eBzOTua4ILKAMCxAT0zRfvwXl34Y++F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