From: Russell King Date: Sun, 30 Oct 2005 16:32:27 +0000 (+0000) Subject: [DRIVER MODEL] Add missing driver_unregister in i2c-s3c2410 failure path. X-Git-Tag: v2.6.15-rc1~59^2~6^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e32e28edc3d894201e15b19df627af66023aa91f;p=linux-2.6 [DRIVER MODEL] Add missing driver_unregister in i2c-s3c2410 failure path. Signed-off-by: Russell King Acked-by: Greg Kroah-Hartman --- diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index a1268e5342..1b582262e6 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -918,8 +918,11 @@ static int __init i2c_adap_s3c_init(void) int ret; ret = driver_register(&s3c2410_i2c_driver); - if (ret == 0) - ret = driver_register(&s3c2440_i2c_driver); + if (ret == 0) { + ret = driver_register(&s3c2440_i2c_driver); + if (ret) + driver_unregister(&s3c2410_i2c_driver); + } return ret; }