From: Jean Delvare Date: Tue, 29 Apr 2008 21:11:38 +0000 (+0200) Subject: i2c-amd756-s4882: Fix an error path X-Git-Tag: v2.6.26-rc1~353^2~2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee56d977423a58b53fd0fc1ef0aca0c9cb564c53;p=linux-2.6 i2c-amd756-s4882: Fix an error path If initialization fails, we want to restore the physical bus, not delete it again. Signed-off-by: Jean Delvare --- diff --git a/drivers/i2c/busses/i2c-amd756-s4882.c b/drivers/i2c/busses/i2c-amd756-s4882.c index e5e96c8175..c38a0a1122 100644 --- a/drivers/i2c/busses/i2c-amd756-s4882.c +++ b/drivers/i2c/busses/i2c-amd756-s4882.c @@ -1,7 +1,7 @@ /* * i2c-amd756-s4882.c - i2c-amd756 extras for the Tyan S4882 motherboard * - * Copyright (C) 2004 Jean Delvare + * Copyright (C) 2004, 2008 Jean Delvare * * 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 @@ -231,7 +231,8 @@ ERROR2: kfree(s4882_adapter); s4882_adapter = NULL; ERROR1: - i2c_del_adapter(&amd756_smbus); + /* Restore physical bus */ + i2c_add_adapter(&amd756_smbus); ERROR0: return error; }