i2c: ocores: add missing unwind goto in `ocores_i2c_probe`
Subsystems (2)
PATCH 1/1 i2c: ocores: add missing unwind goto in `ocores_i2c_probe`
The error handling code after the err_clk label should be executed to release any resources that were allocated for the clock if a negative error code returned.
Fix this by assigning irq to ret and changing the direct return to err_clk.
Signed-off-by Wang Zhang <[email protected]>
Reviewed-by Dongliang Mu <[email protected]>
--- drivers/i2c/busses/i2c-ocores.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-ocores.c +4 -2
@@ -697,8 +697,10 @@ static int ocores_i2c_probe(struct platform_device *pdev)if (irq == -ENXIO ) { ocores_algorithm.master_xfer = ocores_xfer_polling; }else { -if (irq <0 ) -return irq; +if (irq <0 ) { + ret = irq; + goto err_clk; + } }if (ocores_algorithm.master_xfer != ocores_xfer_polling) {
Signature · 1 line
2.34.1