From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8C11C433C1 for ; Tue, 23 Mar 2021 19:18:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9893D619C1 for ; Tue, 23 Mar 2021 19:18:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233329AbhCWTRf (ORCPT ); Tue, 23 Mar 2021 15:17:35 -0400 Received: from verein.lst.de ([213.95.11.211]:33892 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233375AbhCWTR2 (ORCPT ); Tue, 23 Mar 2021 15:17:28 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 6A86D68C4E; Tue, 23 Mar 2021 20:17:26 +0100 (CET) Date: Tue, 23 Mar 2021 20:17:26 +0100 From: Christoph Hellwig To: Jason Gunthorpe Cc: Alex Williamson , Cornelia Huck , kvm@vger.kernel.org, Kirti Wankhede , "Raj, Ashok" , Dan Williams , Christoph Hellwig , Leon Romanovsky , Max Gurtovoy , Tarun Gupta Subject: Re: [PATCH 07/18] vfio/mdev: Add missing reference counting to mdev_type Message-ID: <20210323191726.GE17735@lst.de> References: <0-v1-7dedf20b2b75+4f785-vfio2_jgg@nvidia.com> <7-v1-7dedf20b2b75+4f785-vfio2_jgg@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7-v1-7dedf20b2b75+4f785-vfio2_jgg@nvidia.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, Mar 23, 2021 at 02:55:24PM -0300, Jason Gunthorpe wrote: > struct mdev_type holds a pointer to the kref'd object struct mdev_parent, > but doesn't hold the kref. The lifetime of the parent becomes implicit > because parent_remove_sysfs_files() is supposed to remove all the access > before the parent can be freed, but this is very hard to reason about. > > Make it obviously correct by adding the missing get. Looks good: Reviewed-by: Christoph Hellwig