Commit ceb013b
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>1 parent 09f0290 commit ceb013b
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1416 | 1416 | | |
1417 | 1417 | | |
1418 | 1418 | | |
1419 | | - | |
1420 | 1419 | | |
1421 | 1420 | | |
1422 | 1421 | | |
| |||
1430 | 1429 | | |
1431 | 1430 | | |
1432 | 1431 | | |
| 1432 | + | |
1433 | 1433 | | |
| 1434 | + | |
| 1435 | + | |
1434 | 1436 | | |
1435 | 1437 | | |
1436 | 1438 | | |
| |||
0 commit comments