public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] i2c: i801: Fix using mux_pdev before it's set
@ 2024-03-03 10:45 Heiner Kallweit
  2024-03-04  0:33 ` Andi Shyti
  2024-03-06 11:55 ` Andi Shyti
  0 siblings, 2 replies; 3+ messages in thread
From: Heiner Kallweit @ 2024-03-03 10:45 UTC (permalink / raw)
  To: Andi Shyti, Jean Delvare, Wolfram Sang; +Cc: linux-i2c@vger.kernel.org

i801_probe_optional_slaves() is called before i801_add_mux().
This results in mux_pdev being checked before it's set by
i801_add_mux(). Fix this by changing the order of the calls.
I consider this safe as I see no dependencies.

Fixes: 80e56b86b59e ("i2c: i801: Simplify class-based client device instantiation")
Cc: stable@vger.kernel.org
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
v2:
- cc stable
---
 drivers/i2c/busses/i2c-i801.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 223cd2b84..8e95db95c 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1762,9 +1762,9 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
 
 	i801_enable_host_notify(&priv->adapter);
 
-	i801_probe_optional_slaves(priv);
 	/* We ignore errors - multiplexing is optional */
 	i801_add_mux(priv);
+	i801_probe_optional_slaves(priv);
 
 	pci_set_drvdata(dev, priv);
 
-- 
2.43.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] i2c: i801: Fix using mux_pdev before it's set
  2024-03-03 10:45 [PATCH v2] i2c: i801: Fix using mux_pdev before it's set Heiner Kallweit
@ 2024-03-04  0:33 ` Andi Shyti
  2024-03-06 11:55 ` Andi Shyti
  1 sibling, 0 replies; 3+ messages in thread
From: Andi Shyti @ 2024-03-04  0:33 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: Jean Delvare, Wolfram Sang, linux-i2c@vger.kernel.org

Hi Heiner,

On Sun, Mar 03, 2024 at 11:45:22AM +0100, Heiner Kallweit wrote:
> i801_probe_optional_slaves() is called before i801_add_mux().
> This results in mux_pdev being checked before it's set by
> i801_add_mux(). Fix this by changing the order of the calls.
> I consider this safe as I see no dependencies.
> 
> Fixes: 80e56b86b59e ("i2c: i801: Simplify class-based client device instantiation")
> Cc: stable@vger.kernel.org
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org>

Thanks,
Andi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] i2c: i801: Fix using mux_pdev before it's set
  2024-03-03 10:45 [PATCH v2] i2c: i801: Fix using mux_pdev before it's set Heiner Kallweit
  2024-03-04  0:33 ` Andi Shyti
@ 2024-03-06 11:55 ` Andi Shyti
  1 sibling, 0 replies; 3+ messages in thread
From: Andi Shyti @ 2024-03-06 11:55 UTC (permalink / raw)
  To: Jean Delvare, Wolfram Sang, Heiner Kallweit; +Cc: linux-i2c

Hi

On Sun, 03 Mar 2024 11:45:22 +0100, Heiner Kallweit wrote:
> i801_probe_optional_slaves() is called before i801_add_mux().
> This results in mux_pdev being checked before it's set by
> i801_add_mux(). Fix this by changing the order of the calls.
> I consider this safe as I see no dependencies.
> 
> 

Applied to i2c/i2c-host-fixes on

git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git

Thank you,
Andi

Patches applied
===============
[1/1] i2c: i801: Fix using mux_pdev before it's set
      commit: b60b86b55400413e5f2f1c076f5a2f535341c9ce


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-06 17:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-03 10:45 [PATCH v2] i2c: i801: Fix using mux_pdev before it's set Heiner Kallweit
2024-03-04  0:33 ` Andi Shyti
2024-03-06 11:55 ` Andi Shyti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox