i2c: Fix error value returned by several bus drivers
When adding checks for ACPI resource conflicts to many bus drivers, not enough attention was paid to the error paths, and for several drivers this causes 0 to be returned on error in some cases. Fix this by properly returning a non-zero value on every error. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: stable@kernel.org
This commit is contained in:

committed by
Jean Delvare

parent
a429638cac
commit
7c1f59c9d5
@@ -147,7 +147,7 @@ static int __devinit sis5595_setup(struct pci_dev *SIS5595_dev)
|
||||
u16 a;
|
||||
u8 val;
|
||||
int *i;
|
||||
int retval = -ENODEV;
|
||||
int retval;
|
||||
|
||||
/* Look for imposters */
|
||||
for (i = blacklist; *i != 0; i++) {
|
||||
@@ -223,7 +223,7 @@ static int __devinit sis5595_setup(struct pci_dev *SIS5595_dev)
|
||||
|
||||
error:
|
||||
release_region(sis5595_base + SMB_INDEX, 2);
|
||||
return retval;
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int sis5595_transaction(struct i2c_adapter *adap)
|
||||
|
Reference in New Issue
Block a user