提交 c75793d8 编写于 作者: K Krzysztof Kozlowski 提交者: Linus Walleij

gpio: max732x: Fix I2C dummy device resource leak on probe failure

In max732x_probe() driver allocates dummy I2C device (if number of ports
is greater than 8) however it is not unregistered if probe fails later.
Fix the leak by unregistering dummy I2C device if it was allocated.
Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 49e1f91c
......@@ -647,6 +647,8 @@ static int max732x_probe(struct i2c_client *client,
return 0;
out_failed:
if (chip->client_dummy)
i2c_unregister_device(chip->client_dummy);
max732x_irq_teardown(chip);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册