Received: by 2002:a05:622a:1442:b0:3a5:28ea:c4b9 with SMTP id v2csp673081qtx; Thu, 17 Nov 2022 05:03:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf7t0A/Pt9eAmv6e7xM4eS2pGiyaLJwy4NJYa0A9nmfJKXIPEOMSzkrQrGi/LtKqv2G3Y3MR X-Received: by 2002:aa7:d156:0:b0:468:51b0:295 with SMTP id r22-20020aa7d156000000b0046851b00295mr2046746edo.319.1668690230323; Thu, 17 Nov 2022 05:03:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668690230; cv=none; d=google.com; s=arc-20160816; b=mT1yDUpsoomdg37J1SeiUcd4Dc7fA87c5ZGj/nxHm2AedpXWs1OMRD5QmMQfdyEHSG F9yCiVBxjOph0qQk2spdDnS+UjCWA5gftv/d2gbNexLJZ7U3Izen2iNNgM35BGtG4a0w xnuVDd4iZ/H7496nQQNi1k0cl0qegNy8GcC9DH0BOyPsQrJp8H1nWxZh7XS3ySPezAUH pO3TuPTu86Y8+mJdZ8zsEYdOLlh+VX8rA8eJiwal7DuOfWzqTKro2lgV0hiJZAeXRBrd xrFAlM3wp7UTaxmAI+YRvQiXRk/t910hpK968luLk91JDSVc9moPi/ajt4PQYyLUTQWP qplg== 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=8Fe7PEbyhKo6PNcRij2QVGZQf8ZzgOqxtduzeDOqEHM=; b=XTqy65quZPMRLva6UpnfA1xtUV1FbQOFdIntH6Do7gKcVdG575FDYBZZW890LI86ze aOin1C6mogDfZg3GrsLDcQYm3EpaBH+BUwA6wRdsDV80S95L5urRccAoXQdRlz1vYV4F +gjJdxdnxZSzbXRT5rqcj0KM7LF7C1Coe4UEItmkczfyONen2HPv6ae6nrvkTcPPTu6n vhAjSv499II91tpRKSOTbkjDrYpXgo7ETNgtqVHvAQWB4OPrtrokKL4+b7+/ONKLWz1M QkT78jSSmH3DLIikaUvNF+UjXmYK0WvtohybdqlvQwgZ9bEEW76ggQM889MyGFM6VInT uSEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=H8hN9AB9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w15-20020a056402268f00b00468f45c947fsi578734edd.568.2022.11.17.05.03.02; Thu, 17 Nov 2022 05:03:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=H8hN9AB9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234851AbiKQMvX (ORCPT + 93 others); Thu, 17 Nov 2022 07:51:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238685AbiKQMvB (ORCPT ); Thu, 17 Nov 2022 07:51:01 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 155A756D5C; Thu, 17 Nov 2022 04:51:00 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8B62E61B9D; Thu, 17 Nov 2022 12:51:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E753C433C1; Thu, 17 Nov 2022 12:50:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1668689460; bh=YJ/6UE8ehowwFXAY+Yco2xh0i5799hsaxa+jOvXK6Uo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=H8hN9AB9LcTG66prL8pTtM+doeoakXQDPwETNy/6FWTQhdyRosTqw4Aavoxqym8RC OIAJCp5MBUdYe+WlfjS71iUFk0t3yovuU5Lx22G5KZrZwu8CqPydQUxqYoEWtycOPO HSwN6QGlzo8yK4kT5bU/wBIBbbP1ilPNyS6PnxP4= Date: Thu, 17 Nov 2022 13:50:55 +0100 From: Greg KH To: Lee Jones Cc: balbi@kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH 1/1] usb: gadget: f_hid: Conduct proper refcounting on shared f_hidg pointer Message-ID: References: <20221117120813.1257583-1-lee@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221117120813.1257583-1-lee@kernel.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 On Thu, Nov 17, 2022 at 12:08:13PM +0000, Lee Jones wrote: > +static inline bool f_hidg_is_open(struct f_hidg *hidg) > +{ > + return !!kref_read(&hidg->cdev.kobj.kref); > +} Ick, sorry, no, that's not going to work and is not allowed at all. That's some major layering violations there, AND it can change after you get the value as well. greg k-h