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 4189EC004C0 for ; Sat, 21 Oct 2023 17:58:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231937AbjJUR6J (ORCPT ); Sat, 21 Oct 2023 13:58:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232018AbjJUR6G (ORCPT ); Sat, 21 Oct 2023 13:58:06 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7681710D1 for ; Sat, 21 Oct 2023 10:57:56 -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=hXsZ RP/a3gnp3dVJ7R1TeAIfyr8d8pWyuOqF53C7DNg=; b=KxwTvBb4LjdKalojAuWJ x+uFHJax7EuoJdu3GQbH7tOt77ECMvpT28pMD4oBIs6UVfH0+eFYMbcK4WNUF4yZ rIbT4oJ/XKd1WpFKfJ8OWpPm5BjKXQUhZTaB6XiDfIgobAtqnW/tylW0c2j8rPy8 lPlcWAWy4ngrLr6aS+h6I7yHIElPh+eo/1lBt82tuF+V/FDdXokVoptPikyDGlGF uJCyy9f32shBdlD5KNzfHFyHpe9VVS3V0yv6W8p61jBELPFofDTvtCCSLH8TPb63 TrUVGr2qSMScukyPzAm0rucSoJvZqqBdsmox1+UTlS9foRAR/KWGrQDUoKW9FF6G KA== Received: (qmail 1472773 invoked from network); 21 Oct 2023 19:57:53 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 21 Oct 2023 19:57:53 +0200 X-UD-Smtp-Session: l3s3148p1@011nuj0IqMkgAQnoAGobAPDYRw1R6KxZ Date: Sat, 21 Oct 2023 19:57:53 +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 2/3] i2c: muxes: i2c-demux-pinctrl: 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-3-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8dcyqXc9Mv1THXa4" Content-Disposition: inline In-Reply-To: <20231020153017.759926-3-herve.codina@bootlin.com> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org --8dcyqXc9Mv1THXa4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 20, 2023 at 05:30:12PM +0200, Herve Codina wrote: > i2c-demux-pinctrl 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: 50a5ba876908 ("i2c: mux: demux-pinctrl: add driver") > Signed-off-by: Herve Codina > Cc: stable@vger.kernel.org > Acked-by: Peter Rosin > Reviewed-by: Jonathan Cameron Applied to for-current, thanks! --8dcyqXc9Mv1THXa4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmU0ESEACgkQFA3kzBSg KbYvzA//WO35C41c5gv7XQED/1iuVpp/Q+nbB3Un6IbBaftLvVwTMQA1VWWP/vks M/98EKFT8hRLvunOcT9y4P1559gm9CVxzuRllvhUMLKBmnZFgaS/W+czUf6zbR2g mk/nr0jGzyB+B+htJE3dh31Jd5MNc16/zAf/rSet58x/rSEsEC6WNFA9I8E6Qn2M zCHMKva2kI5H/PYfqNZa8eZbX1YzPO3zUonex5JvP9tSmYwLt+zGsMeEJovb0uqZ l3pORrwsF0cxw6sRVNno8596C9WZEEuz4X6EmK9hCUSDmQVV0w9gcUuQc/pH7oyN Vpci9L0S3nHlgNtFOEl0lmDZnWOH7KA13vdmfnPBOkJMRUyU/EHbPHGmZShdh7rm Mn4iSV71SyYQfffNZIXwGDIVBXr8EwvtJdd+frvGNlBQe/vQYQd8BUWzeZ8xtSYc v0YbIJ0wqd4OZ/mk4SkDrfWArSxeWvZ+kqyOeB4Na9+X0D3G6tkF4pxTSRNU+wsG ggDaX9erIM0rmHeh+O0VTf4JhR+XUwZ3481BnVQ81KBbH1r2n0woJ5i2vD3R3wKO 4mz0yKOXwNaJY8YPO5wBLaOzr2P6FgzAI7Kzs8COvPxpbBWswSRgp27GVbcJwMjT qnWz/bof/P8/BrBvUW5iMWwm3CdOqiksTcmia3ojvrwRb+7QFNk= =KxuJ -----END PGP SIGNATURE----- --8dcyqXc9Mv1THXa4--