Skip to content

Commit

Permalink
i2c: i801: Fix using mux_pdev before it's set
Browse files Browse the repository at this point in the history
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: 80e56b8 ("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>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
  • Loading branch information
Heiner Kallweit authored and Wolfram Sang committed Mar 8, 2024
1 parent 90d35da commit 09f0290
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-i801.c
Original file line number Diff line number Diff line change
Expand Up @@ -1742,9 +1742,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);

Expand Down

0 comments on commit 09f0290

Please sign in to comment.