Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7872132pxb; Fri, 19 Feb 2021 01:13:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyYnuwHTeqtc6l+0cxXIosAgzXOjTnvRB+5ShvWD0bRKgC1lM403oYKCUGP7AizpII0HxoA X-Received: by 2002:a05:6402:144b:: with SMTP id d11mr8148044edx.329.1613725981810; Fri, 19 Feb 2021 01:13:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613725981; cv=none; d=google.com; s=arc-20160816; b=dXA1rr54IbpQCDj/Uwv+MWhFjPJZjO8gsyGB3w0TE5S2UexCF3ivmlIrJLFTY1Saj6 xuRa/vGWw4PwNdXTv2PURRWwx/DeRPYDW9usiX5K/eiLix1f+y8EwqexBAcX2597WXhJ si4UMqAEKpxkEutwi9D6OdeWxWUdHb/vhhU4RWrA48ZfO2jLN39h71RzH6i0jwmLUTKi 567yjPxysWYS9wvmyPgjq9Oq5rnjk8+66KQNuPqZgof4sKvYvEdglPkIOUYiNmEAJlJJ QyGVIe6uVAq4t6M5q0/sF+a+pvDA66ywNKTSmwqpyqXqy+g4fZ89A1XW3TzOdqqBWyL1 83eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gOl1hE7MmU/8MiLX+4M6Dnx+C2sPG7yw7I56T+6Heb0=; b=FY0TXauaIdZcMUUCC7BU0teoHqyEwdAxY2kOwqp19OWgysHWRH53qDAwRsOyIvSYkq nqdBVcoHH3MDaa5ooLjbMYF2nbeinOol/ncRa4AMZcMJReOPFIiVIUynplaeeuFvoWvD b3JRIqLiAxAMNMz/buTqgeIPYOIyxHkKq4vs94JJAKvmKJ+lyJnb+3VuBHfsLHc5bzAM H+XDsO1TncGzO552ozywc8YCBJf7Tj0XU3vLykUsE30sb70B+u5waeLuS842a5OvWwgo ZiOBZ5KE1EzNgnLtKDt6jmXiOPkH7wk/4DFqHc3rm9O5e1t2S9cedQLZepwoB/Ex2INu tPWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HF6TCyaL; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lb22si5793575ejc.276.2021.02.19.01.12.38; Fri, 19 Feb 2021 01:13:01 -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=@kernel.org header.s=k20201202 header.b=HF6TCyaL; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230221AbhBSJMH (ORCPT + 99 others); Fri, 19 Feb 2021 04:12:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:37646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229953AbhBSJGu (ORCPT ); Fri, 19 Feb 2021 04:06:50 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0B86F64E5C; Fri, 19 Feb 2021 09:06:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613725569; bh=9gCM57rLof4KH7lXmy+UmvuKw9FROg+FI9WlxlntM6k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HF6TCyaLMin7eWw4jcFe+dmeJli3eaPGNiRqFJOdifpw3v3jT+JZYAaUBeXZy74Go aeiwwSMCGDPuDcaeovq08+UTBhBykv6GzjbK79+AN4G3Z294+JgpaFB6c2ldOXfDGH KGoZJ2CBsqQSsqeQ3wVPGEav0wxTPIPxyuxdIew4rJ2erUfLcnJ2GE8PMM1ofzS5dy hqLP0Et4AKssHZqw1fH+RJNZDAe0vFzDiJ91PXDYRg2nSQ/1VkTFxka46a4mvxtP7F OjPhJ+HLcsd7zYl/fiwPqNZft4tb1qzXCfzpUGYAqjgCY16xVibPybPOMfK79UnnCy 7B20K57epD1kw== Date: Fri, 19 Feb 2021 11:05:54 +0200 From: Jarkko Sakkinen To: Lino Sanfilippo Cc: peterhuewe@gmx.de, jgg@ziepe.ca, stefanb@linux.vnet.ibm.com, James.Bottomley@hansenpartnership.com, David.Laight@aculab.com, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, Lino Sanfilippo , stable@vger.kernel.org Subject: Re: [PATCH RESEND v5] tpm: fix reference counting for struct tpm_chip Message-ID: References: <1613505191-4602-1-git-send-email-LinoSanfilippo@gmx.de> <1613505191-4602-2-git-send-email-LinoSanfilippo@gmx.de> <5d0f7222-a9ef-809b-cd9a-86bbacb03790@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5d0f7222-a9ef-809b-cd9a-86bbacb03790@gmx.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 18, 2021 at 08:13:57PM +0100, Lino Sanfilippo wrote: > > Hi, > > On 17.02.21 at 23:18, Jarkko Sakkinen wrote: > > >> + > > > > /* > > * Please describe what the heck the function does. No need for full on > > * kdoc. > > */ > > Ok. > > >> +int tpm2_add_device(struct tpm_chip *chip) > > > > Please, rename as tpm_devs_add for coherency sake. > > > > Sorry I confused this and renamed it wrongly. I will fix it in the next > patch version. > > >> +{ > >> + int rc; > >> + > >> + device_initialize(&chip->devs); > >> + chip->devs.parent = chip->dev.parent; > >> + chip->devs.class = tpmrm_class; > > > > Empty line. Cannot recall, if I stated before. > >> + /* + * get extra reference on main device to hold on behalf of devs. > >> + * This holds the chip structure while cdevs is in use. The > >> + * corresponding put is in the tpm_devs_release. > >> + */ > >> + get_device(&chip->dev); > >> + chip->devs.release = tpm_devs_release; > >> + chip->devs.devt = MKDEV(MAJOR(tpm_devt), > >> + chip->dev_num + TPM_NUM_DEVICES); > > > > NAK, same comment as before. > > > > Thx for the review, I will fix these issues. Yeah, I mean I'm going to collect this fix anyway after rc1 has been released so there's a lot of time to polish small details. I.e. I'm doing a PR for rc2 with the fix included. > Regards, > Lino /Jarkko