UPSTREAM: mfd: intel_quark_i2c_gpio: Remove clock tree on error path

There is a potential resource leak in case when ->probe() fails. We have to
unregister and remove clock tree which is done here.

This is a follow up to previously pushed commit c4726abce63b ("mfd:
intel_quark_i2c_gpio: Use clkdev_create()") that prevents double free() when
clkdev_drop() followed by kfree() in devm_kcalloc() release stage.

I leave Fixes tag here, but the backporting will require to backport the commit
c4726abce63b ("mfd: intel_quark_i2c_gpio: Use clkdev_create()") first.

TEST=Build i386:allmodconfig

Change-Id: I822d226e0628c8fc577dae78da2091eea00967f6
Fixes: 60ae5b9f5cdd (mfd: intel_quark_i2c_gpio: Add Intel Quark X1000 I2C-GPIO MFD Driver)
Signed-off-by: Andy Shevchenko <>
Acked-by: Stephen Boyd <>
Signed-off-by: Lee Jones <>
Signed-off-by: Guenter Roeck <>
(cherry picked from commit 7f0c5ae18d64)
Reviewed-by: Dylan Reid <>
1 file changed