Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5960494pxb; Tue, 16 Feb 2021 11:57:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzB6kVvOPVIr8pjwt8VMCxbzDBkN0/wgMbCnkuyd/Pjs3ejUvySA6uWGSRm/rtpDqasx9q4 X-Received: by 2002:a50:bf42:: with SMTP id g2mr22735704edk.101.1613505445077; Tue, 16 Feb 2021 11:57:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613505445; cv=none; d=google.com; s=arc-20160816; b=sUOFNGuyfLq6y6Ns/k6+eph8fqGJt3pqwbkQGdo1qIbtqCZKYaF9CLRNLJTPbN93vL 12G6ZDY8ALPH5Gb0POnPPjux3Xsnsu4OM1J6g2GyI7VgqYG8c3m08u5gJTg6W38ZvkkX XNrrMBRkt+hj3xA2GHfSQCcUr4oSIOhWVCuXwxXm88LkrClTwyuzx2GLDw6fCX/wCKQd Us21CSs6A/jM7Q8+2F/eJhd3IyLMSJwY3MI3hsP95NOszblwmLuB+zbpunTrL3QnNTxz iZVMkrLwmvfYC3AAGsET0FNdbDQOR6gTC4XrYwAk2Y/001//Uilo4tSJfT4LzxMe6bNZ gPyQ== 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=hh+kssisUucOOJeKV5TXjOEotlLuzyrxSMOZr528Puc=; b=uDECeHQClA+Nuea5UyiEAgEEislWVq3ubgwK78xoFUAdKJHk+HiURu93Qom6rLoyku 4Pm3RXKzXvVJWmvTnYl2cg3Pp7KLasy+Pj4sA82rIxIFdOqpRgjXPs1o3t8vhcpcpWu9 1ObiftTfWVULnOccMo/Id4p4spySaX+tjo6y0o61cOu64IZIOo0i8Nn0F1tAxqd+XKGE 77d37QSlyBVNKFOykOlJDap8L1FukfRV20D6ONmEbb6+uPcAP+MvI+oNkU7tEaL8b1BB hrdjrPdPePkXW09qjQPgX903aBGx3DjV/fNO8glH8iB7TOn6KXeCe4c/U8Xh1oTdzaPF GUcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b="V2/8k1W1"; 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 j21si15828884ejn.713.2021.02.16.11.57.01; Tue, 16 Feb 2021 11:57:25 -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="V2/8k1W1"; 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 S229912AbhBPTz4 (ORCPT + 99 others); Tue, 16 Feb 2021 14:55:56 -0500 Received: from mout.gmx.net ([212.227.17.21]:51569 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbhBPTzt (ORCPT ); Tue, 16 Feb 2021 14:55:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1613505246; bh=hh+kssisUucOOJeKV5TXjOEotlLuzyrxSMOZr528Puc=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=V2/8k1W1tmU/wp4bp0So+RNFuyU1Hdf0udlA9LPSFnz2Lg/bxnqxkz2cT8rUm64Im 5JS/pHu4+JEssj1ENvpkBcKz7hRSBJyo56VQRvqm8eIF153Arw3s6n5e8IXQShlV1j EjTfZ+H0yBhAGi8+8BPCaNTQ1E25b4rQnoqAp42U= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from Venus.fritz.box ([78.42.220.31]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N1Obb-1lsu503qDD-012lwq; Tue, 16 Feb 2021 20:54:06 +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, LinoSanfilippo@gmx.de, Lino Sanfilippo , stable@vger.kernel.org Subject: [PATCH RESEND v5] tpm: fix reference counting for struct tpm_chip Date: Tue, 16 Feb 2021 20:53:11 +0100 Message-Id: <1613505191-4602-2-git-send-email-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613505191-4602-1-git-send-email-LinoSanfilippo@gmx.de> References: <1613505191-4602-1-git-send-email-LinoSanfilippo@gmx.de> MIME-Version: 1.0 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:ZpAgzsJA3bBK4bNOf6zHUgQj0IV2qCwSdfV003IUJ8YYFOs4tmb e5q4sF5r7imdh13Cbp6gxMnMZG4PvW2L2JzBBPNlLluFp1Dzgn49yjEftXQvHdLUADsKPrf 9RuShYYQqmFy6iWBz9SwIjlBjhM5lw5KN6PCe7v6qVIHMsJEH7o4WahFnJiUEcw90N3WYnO 2VX3Q+ni6EVp8sMIff0+w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:J8C4xKwfmqo=:7mL4pyJ1Zkti9LPIlKosBr QUQxn/+OOz4hQ2Z98FK3kW6aiLYkEvo3T991ZR80eyQ0m07GBx7+wXcFraKVVrMNpQ9Ft4HqR of7mldR/jpBHl7nMclze0KU0b6CQKNF8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