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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 959F8C004C0 for ; Sat, 21 Oct 2023 17:58:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232050AbjJUR6X (ORCPT ); Sat, 21 Oct 2023 13:58:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231356AbjJUR6W (ORCPT ); Sat, 21 Oct 2023 13:58:22 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44272D53 for ; Sat, 21 Oct 2023 10:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=k1; bh=1tph RT4/fr6VXmFmt73f2t/eEw2/hid0bq+Uk88Fnc0=; b=T01xIk/LpseplDjUziNG OiJnc67xrhwoXXqnOMtdMAYKIkirBLh5hIVYPPaQtRHWIWVuJI+BhVY5f2yxUAbU t8tBTvVQ/S5cnGmxRcmDoEoTa4ri5NpX8g2SedCUQndPwUo2cQK6ZQUI9VgqrLM8 2zqv4EO/z75WIcNRNgbTzcYwB8TaJQoHcMplObC92ee4CNsYp0pgU3h1Mmgo1aiY CMRQ9f7AqteFjRlJjuZfsivZOdB6c7gVueECb/7poxHDuH8ow30qCGtwPQgeSe3D Wla7upnqYqXReHI9nQMGw8uigzDtsbCEDCwzoR9KbKMfGNSk1Pp1ltsyeXkZaiP3 kg== Received: (qmail 1472854 invoked from network); 21 Oct 2023 19:58:09 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 21 Oct 2023 19:58:09 +0200 X-UD-Smtp-Session: l3s3148p1@UZJNuz0IEpkgAQnoAGobAPDYRw1R6KxZ Date: Sat, 21 Oct 2023 19:58:08 +0200 From: Wolfram Sang To: Herve Codina Cc: Peter Rosin , Stephen Warren , Rob Herring , Greg Kroah-Hartman , Jonathan Cameron , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Allan Nielsen , Horatiu Vultur , Steen Hegelund , Thomas Petazzoni , stable@vger.kernel.org, Jonathan Cameron Subject: Re: [PATCH v3 3/3] i2c: muxes: i2c-mux-gpmux: Use of_get_i2c_adapter_by_node() Message-ID: Mail-Followup-To: Wolfram Sang , Herve Codina , Peter Rosin , Stephen Warren , Rob Herring , Greg Kroah-Hartman , Jonathan Cameron , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Allan Nielsen , Horatiu Vultur , Steen Hegelund , Thomas Petazzoni , stable@vger.kernel.org, Jonathan Cameron References: <20231020153017.759926-1-herve.codina@bootlin.com> <20231020153017.759926-4-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bKdObAA9+5DRRzFe" Content-Disposition: inline In-Reply-To: <20231020153017.759926-4-herve.codina@bootlin.com> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org --bKdObAA9+5DRRzFe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 20, 2023 at 05:30:13PM +0200, Herve Codina wrote: > i2c-mux-gpmux uses the pair of_find_i2c_adapter_by_node() / > i2c_put_adapter(). These pair alone is not correct to properly lock the > I2C parent adapter. >=20 > Indeed, i2c_put_adapter() decrements the module refcount while > of_find_i2c_adapter_by_node() does not increment it. This leads to an > underflow of the parent module refcount. >=20 > Use the dedicated function, of_get_i2c_adapter_by_node(), to handle > correctly the module refcount. >=20 > Fixes: ac8498f0ce53 ("i2c: i2c-mux-gpmux: new driver") > Signed-off-by: Herve Codina > Cc: stable@vger.kernel.org > Acked-by: Peter Rosin > Reviewed-by: Jonathan Cameron Applied to for-current, thanks! --bKdObAA9+5DRRzFe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmU0ETAACgkQFA3kzBSg KbYotw/9H5yLe18QGWIzB99u5ZQtqYrFPqfJ97aASuvaLBJH5D2I2oMEu5VfOe3r n5uW6mKilgM/g1Dw0jzfNXP+rzrc1beu7KeYK7WIhtmvdet7WYd+KzJYfM/Pxy/e 6izTwfCNW4p2A0xjb+T4kN0/GYnUIvG9SfbJsSpB6jlLplZ2uoTOqMMIfr0kx1bi nkfXvaJv2KwhaNRZq9WSDekHLYPPEQNvXnOgvDKWPz7EP45IpBAodw9GAXa8Eq4c sCn6e/0vbuCNp8r/iMGpMFZMgZVaiQe0R0tTt4bHatmzMjUe7kCJytJnu6GYt2kj 0QKX/1ubGVhkjfr0/1xxjCVNJrzFD71EX2BcR60v7N51xErhcSkMyy6kiL1JiYCt R3HOa3MhUbcwrsFgXjkx3z1/VRHTVONijY62ayORKdo9ovdQ10+dfLNrQ3TYw4X2 KyJCPbaoSsvUyZEnLt2oMPNZZ7+L5ePsz+nNc+agcW1D0UJen53dU+7zr2TYRf3g 0TsVoA89J0z/282ycr4bKc4Mlszb3+bEOxuHmQ3VqbvjMKA5oj1zBgoMwEhjb3GK t5M+11mb0wnpIDL0+1pY6humwzYUAdTYiAIHfiAsI3evHhww9XCJrOYpP0MChO3e B1Wp+f1tpTqh3A/w+gmmpeCvtWoC3THouTVcHAW4KxujrbBRo3w= =YdAO -----END PGP SIGNATURE----- --bKdObAA9+5DRRzFe--