Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp240117rdb; Thu, 19 Oct 2023 03:10:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHHKx+rI0lpRKCjsT2OMjhOL6VLEPFeMnHGM9JVL2yFzRg2ycFUjHlAlKIgFee0mdvjg1nZ X-Received: by 2002:a9d:7d92:0:b0:6c0:abdd:a875 with SMTP id j18-20020a9d7d92000000b006c0abdda875mr1758455otn.18.1697710255489; Thu, 19 Oct 2023 03:10:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697710255; cv=none; d=google.com; s=arc-20160816; b=C3cE0GE/HBahIlwReAmknaz2J0NKv88BIcWWfMfV5CksryOfzVbC9opIx2DT8nyvjp ONAQBHReHDaf0+0a+tYkf7hSMP7mlcg/oZxbdQIftF2FuFcc+38//mF5QHz1Vvc8Uzh6 ql1OvN7HhUafufu3OxiFBiegyWp4kdDqjon1RvhDdAU/4zw7JuxR5dw9TjhS7wcI3wWo bDum9xch99VDIdLYZLqVewx9soicMVOvCd0C0n4SqBRbgwgCmzI5dl4YgyxI2yEQrvfs 52vlt0FfQTcOnE6kz2u6euKGKZGzqhvHK3VgT7o2kHhb+bpUBKc8jjr3mp4Yl3OsUljh 30Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+QL1vCu0aBMDA8mdjFy+OQgIj/mtB+gsf9+18KdaYWI=; fh=i3WS+6AgTKP10/eUP7j46CA4B/XR5qlEIT9hV1ltHe4=; b=g2OTWcBY/lw4U44iTiQsJoWCi4fyPUI2KSWkuJhBgvl+5Wf0M0aNr2IVA7bRSt8K5o vkl7e3qbYg9UrVPkmiLOKGbk5+8HU1D1ghGw5Wz0uAg/p2NA0dO2O01nz4h/Qw03cYvm pEfAbsIURl8k/PReR5KrJHltOVB9JtVlMkrXHBn33QAToVhvWeJpzrQ1DCt1S89DUfAm 10KPJ6xeIEspqNnF6vKk/W2ja6Gx9V+NPA7O+TILU9dwZ6j7iyJfWAtSRwIuAG76hNwF jUWWMgPYyO84jVdxMUkrTtuE7BWHKV9M0tiLZ2esHgbH/mh5oidozk/mR6TRgzaxYnNv q8Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Ds1OJJ0e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id j1-20020a056a00130100b006be0559d029si6076334pfu.109.2023.10.19.03.10.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 03:10:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Ds1OJJ0e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 19F4680A87D2; Thu, 19 Oct 2023 03:10:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345226AbjJSKK1 (ORCPT + 99 others); Thu, 19 Oct 2023 06:10:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345206AbjJSKKZ (ORCPT ); Thu, 19 Oct 2023 06:10:25 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BA6911F; Thu, 19 Oct 2023 03:10:23 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id CEEAEC0003; Thu, 19 Oct 2023 10:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697710221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+QL1vCu0aBMDA8mdjFy+OQgIj/mtB+gsf9+18KdaYWI=; b=Ds1OJJ0eeiL4VRdf2eS6s9Ljng/TBpOqfT2PgqU5widgB7GOb4ws4XinErF1rxi0EgDyV7 iWt7tSaobsU7voEZrtNtQRR/3sIPJ5uxjjt5eNjp7WgDodxVjfoHkK+mJ757RuEFvQrucS BjtEc5u6ykbWRtk0ImRY+DRppb0F28MatC7EKssjWe0PN5AOpchiSXob3HLOBQqyZDPvth zE+QMJrP1BETufYs7Gb/W1r8L66kI5raPR5P6Jie43r+EO8fL/B3oWNFPgZDGHpy8jVVGi MUnpEW0+D0eHG0aahTU6ejX4gKMVPoQICutpZvrrSxj0rcEguhKYBHWjRjw2dw== From: Herve Codina To: Wolfram Sang , Peter Rosin , Stephen Warren , Rob Herring , Greg Kroah-Hartman , Jonathan Cameron Cc: Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Allan Nielsen , Horatiu Vultur , Steen Hegelund , Thomas Petazzoni , Herve Codina Subject: [PATCH v2 0/3] Fix i2c mux module refcount issues Date: Thu, 19 Oct 2023 12:10:13 +0200 Message-ID: <20231019101017.425284-1-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 19 Oct 2023 03:10:38 -0700 (PDT) Hi, Some i2c mux drivers wrongly use the pair of_find_i2c_adapter_by_node() / i2c_put_adapter() to lock the parent adapter. Indeed, i2c_put_adapter() decrements the module refcount while of_find_i2c_adapter_by_node() does not increment it. This leads to an overflow over zero of the parent adapter user counter. Identified mux drivers impacted are: - i2c-mux-gpmux - i2c-demux-pinctrl - i2c-mux-pinctrl Commit 48e9743dd648 ("i2c: core: add and export of_get_i2c_adapter_by_node() interface") introduces of_get_i2c_adapter_by_node() to correctly handle this refcount issue. This series fixes the 3 identified mux drivers replacing the of_find_i2c_adapter_by_node() call by an of_get_i2c_adapter_by_node() call. Compare to the previous iteration https://lore.kernel.org/linux-kernel/20231019073533.386563-1-herve.codina@bootlin.com/ This v2 series: - Fixes commit log message - Add Fixes and Acked-by tags Best regards, Hervé Changes v1 -> v2: - All patches Fix commit log Add relevant Fixes tag Add 'Acked-by: Peter Rosin ' Herve Codina (3): i2c: muxes: i2c-mux-pinctrl: Use of_get_i2c_adapter_by_node() i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node() i2c: muxes: i2c-mux-gpmux: Use of_get_i2c_adapter_by_node() drivers/i2c/muxes/i2c-demux-pinctrl.c | 2 +- drivers/i2c/muxes/i2c-mux-gpmux.c | 2 +- drivers/i2c/muxes/i2c-mux-pinctrl.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) -- 2.41.0