Skip to content

Commit

Permalink
i2c-amd756-s4882: Fix an error path
Browse files Browse the repository at this point in the history
If initialization fails, we want to restore the physical bus, not delete
it again.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
  • Loading branch information
Jean Delvare authored and Jean Delvare committed Apr 29, 2008
1 parent 306f39f commit ee56d97
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/i2c/busses/i2c-amd756-s4882.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* i2c-amd756-s4882.c - i2c-amd756 extras for the Tyan S4882 motherboard
*
* Copyright (C) 2004 Jean Delvare <khali@linux-fr.org>
* Copyright (C) 2004, 2008 Jean Delvare <khali@linux-fr.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -231,7 +231,8 @@ static int __init amd756_s4882_init(void)
kfree(s4882_adapter);
s4882_adapter = NULL;
ERROR1:
i2c_del_adapter(&amd756_smbus);
/* Restore physical bus */
i2c_add_adapter(&amd756_smbus);
ERROR0:
return error;
}
Expand Down

0 comments on commit ee56d97

Please sign in to comment.