[PATCH -next] i2c: Fix missing pci_disable_device() on error in ali1535_setup()
From: Zou Wei
Date: Sun Jun 06 2021 - 23:02:37 EST
Fix the missing pci_disable_device() before return
from ali1535_setup() in the error handling case.
Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
Signed-off-by: Zou Wei <zou_wei@xxxxxxxxxx>
---
drivers/i2c/busses/i2c-ali1535.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c
index fb93152..bdbaf79 100644
--- a/drivers/i2c/busses/i2c-ali1535.c
+++ b/drivers/i2c/busses/i2c-ali1535.c
@@ -206,6 +206,7 @@ static int ali1535_setup(struct pci_dev *dev)
exit_free:
release_region(ali1535_smba, ALI1535_SMB_IOSIZE);
exit:
+ pci_disable_device(dev);
return retval;
}
--
2.6.2