Commit 147d5bf
committed
i2c: i801: Avoid potential double call to gpiod_remove_lookup_table
JIRA: https://issues.redhat.com/browse/RHEL-47426
commit ceb013b
Author: Heiner Kallweit <hkallweit1@gmail.com>
Date: Mon Mar 4 21:31:06 2024 +0100
i2c: i801: Avoid potential double call to gpiod_remove_lookup_table
If registering the platform device fails, the lookup table is
removed in the error path. On module removal we would try to
remove the lookup table again. Fix this by setting priv->lookup
only if registering the platform device was successful.
In addition free the memory allocated for the lookup table in
the error path.
Fixes: d308dfb ("i2c: mux/i801: Switch to use descriptor passing")
Cc: stable@vger.kernel.org
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: David Arcari <darcari@redhat.com>1 parent 5c18790 commit 147d5bf
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1432 | 1432 | | |
1433 | 1433 | | |
1434 | 1434 | | |
1435 | | - | |
1436 | 1435 | | |
1437 | 1436 | | |
1438 | 1437 | | |
| |||
1446 | 1445 | | |
1447 | 1446 | | |
1448 | 1447 | | |
| 1448 | + | |
1449 | 1449 | | |
| 1450 | + | |
| 1451 | + | |
1450 | 1452 | | |
1451 | 1453 | | |
1452 | 1454 | | |
| |||
0 commit comments