Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6424433pxb; Tue, 15 Feb 2022 02:04:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFDXqspXVUYto27bjmIiug1DG4BQbIVWd9I7aCK7vjLqbafueRxjK6iDKAys1Ccy92MCZg X-Received: by 2002:a17:906:b049:: with SMTP id bj9mr2343082ejb.718.1644919441556; Tue, 15 Feb 2022 02:04:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644919441; cv=none; d=google.com; s=arc-20160816; b=o8CPVuaZxw481UlA12MYBhswtnY+KTV86RPA0l8ThCOTE6X8bd9ctC1fRaF8JrhUKK vlLWnncR2x0hnQO/WWQjOAqFVEjfPxvu9LxKAJ62L92T+IKbThwozM2qFlj4k64+3AnW AixGhEaLqjNUjASXAz2eiTVYKcX3hVBh2atr/TEZnYd0xykYk/w1UR9tFewUlbc+ATJG 8hB/Z3WHMYtpjYN5FDG1gnNYSy9bj9NomkUMFtbtzSHqhUHakfvd1VynOGmhkVFkXH+q Agc7843eeiddKN7DsQZVZ/G9DJHZW0wtjXUpGEqo+LIbZy/Fbklg7f2GjjnOBvUvVVhF TmkQ== 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; bh=WiwMWp6MaF0B7Z4dtiqgtnXgvk/qGD1Fn3U2u/9RV0c=; b=D2qgT8JP51H2CRw0lNiioBKka2k+icAixtLot6v0dMhHzgeAG3mnIM9nZQ3AMMRVig zNZX86M3oRbhuA8A18GGG3TMU6HMVIrjNafr+yjQR2XB1m4xfR1JX75MSBqcnfpLImbu UCK5T3pf1WjH7ukHAdRfbbo6tSBjBESpE6uy9e7Xhgkfcy+Tunz/aC8IpGfmzx3a7Fkm it2zFqwZejZdLvBB7gnwrgcqefYEurYB6PgNsSKsZEAL2g6qpdrHvZgxpfcAMZSS7U// lWEatbDtARnp8BFyJbC3ETSB4ioQETmxf9viH9K0m0GeS+9GYGd/E0ZIHeDRBA6yz7RN 5Ysw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn17si9512424ejc.383.2022.02.15.02.03.38; Tue, 15 Feb 2022 02:04:01 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234671AbiBOINk (ORCPT + 99 others); Tue, 15 Feb 2022 03:13:40 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:37084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231987AbiBOINj (ORCPT ); Tue, 15 Feb 2022 03:13:39 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66A0245067 for ; Tue, 15 Feb 2022 00:13:30 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJsxk-0003ei-D6; Tue, 15 Feb 2022 09:13:28 +0100 Received: from pengutronix.de (unknown [195.138.59.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id 6A8023384F; Tue, 15 Feb 2022 08:13:27 +0000 (UTC) Date: Tue, 15 Feb 2022 09:13:24 +0100 From: Marc Kleine-Budde To: Vincent Mailhol Cc: netdev@vger.kernel.org, linux-can@vger.kernel.org, linux-kernel@vger.kernel.org, Maximilian Schneider Subject: Re: [RFC PATCH v1] can: gs_usb: change active_channels's type from atomic_t to u8 Message-ID: <20220215081324.gkrut2pa3l324rnu@pengutronix.de> References: <20220214234814.1321599-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="z4gra5dh4uqv6g3s" Content-Disposition: inline In-Reply-To: <20220214234814.1321599-1-mailhol.vincent@wanadoo.fr> X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 --z4gra5dh4uqv6g3s Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 15.02.2022 08:48:14, Vincent Mailhol wrote: > The driver uses an atomic_t variable: gs_usb:active_channels to keep > track of the number of opened channels in order to only allocate > memory for the URBs when this count changes from zero to one. >=20 > However, the driver does not decrement the counter when an error > occurs in gs_can_open(). This issue is fixed by changing the type from > atomic_t to u8 and by simplifying the logic accordingly. >=20 > It is safe to use an u8 here because the network stack big kernel lock > (a.k.a. rtnl_mutex) is being hold. For details, please refer to [1]. >=20 > [1] https://lore.kernel.org/linux-can/CAMZ6Rq+sHpiw34ijPsmp7vbUpDtJwvVtdV= 7CvRZJsLixjAFfrg@mail.gmail.com/T/#t >=20 > Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN > devices") > Signed-off-by: Vincent Mailhol Looks good to me, added to linux-can/testing. regards, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --z4gra5dh4uqv6g3s Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEBsvAIBsPu6mG7thcrX5LkNig010FAmILYKEACgkQrX5LkNig 013hGwgAlFjf104cx/rCg+L2FHCMMDuztd+6XhCPSU1in2Q2GNXL+HJE4qPPhDPN VfwENmcf2yH2ecW/kIEducOGt8gl26gC9EzeCIEoiflepU9qfDJ/cqcgqPlP4gcG kcbm+fAomoIrPCTI/UvLUFLX88Oiza1L3x4VaQqGZxevcmPWXzYNQGKosD0F3Oz1 FodizylGOSIBy+1g2xvAXc51Vhnkwo+5rRfZHJhbRzLFGrS9Fbim+QOOib0/hVLJ cAbtI6TQ3CDqU2TBa1kN/BUbCrhzb2C0rOL1nPuTrvxyDF8pgxSeAqJsTJ/g+QGS rOpyugIMCxyvPzjOtbz5oUao6I0NIA== =tkn1 -----END PGP SIGNATURE----- --z4gra5dh4uqv6g3s--